Changeset ce862ac in mainline
- Timestamp:
- 2021-11-02T18:49:52Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b48e680f
- Parents:
- 24c452b3
- Location:
- uspace/app/terminal
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/terminal/main.c
r24c452b3 rce862ac 33 33 */ 34 34 35 #include <ui/ui.h> 35 36 #include <stdio.h> 36 #include <task.h>37 #include <ui/ui.h>38 37 #include "terminal.h" 39 38 … … 98 97 return 1; 99 98 100 task_retval(0); 101 async_manager(); 99 ui_run(terminal->ui); 100 101 terminal_destroy(terminal); 102 102 return 0; 103 103 } -
uspace/app/terminal/terminal.c
r24c452b3 rce862ac 41 41 #include <fbfont/font-8x16.h> 42 42 #include <io/chargrid.h> 43 #include <fibril.h> 43 44 #include <gfx/bitmap.h> 44 45 #include <gfx/context.h> … … 128 129 }; 129 130 131 static errno_t terminal_wait_fibril(void *); 132 130 133 static terminal_t *srv_to_terminal(con_srv_t *srv) 131 134 { … … 133 136 } 134 137 135 static void getterm(const char *svc, const char *app)136 { 137 task_spawnl(NULL, NULL, APP_GETTERM, APP_GETTERM, svc,138 static errno_t getterm(task_wait_t *wait, const char *svc, const char *app) 139 { 140 return task_spawnl(NULL, wait, APP_GETTERM, APP_GETTERM, svc, 138 141 LOCFS_MOUNT_POINT, "--msg", "--wait", "--", app, NULL); 139 142 } … … 804 807 terminal_t *term = (terminal_t *) arg; 805 808 806 (void) term; 807 808 // XXX This is not really a clean way of terminating 809 exit(0); 809 ui_quit(term->ui); 810 810 } 811 811 … … 1014 1014 1015 1015 list_append(&term->link, &terms); 1016 getterm(vc, command); 1016 rc = getterm(&term->wait, vc, command); 1017 if (rc != EOK) 1018 goto error; 1019 1020 term->wfid = fibril_create(terminal_wait_fibril, term); 1021 if (term->wfid == 0) 1022 goto error; 1023 1024 fibril_add_ready(term->wfid); 1017 1025 1018 1026 term->is_focused = true; … … 1040 1048 } 1041 1049 1050 static errno_t terminal_wait_fibril(void *arg) 1051 { 1052 terminal_t *term = (terminal_t *)arg; 1053 task_exit_t texit; 1054 int retval; 1055 1056 /* 1057 * XXX There is no way to break the sleep if the task does not 1058 * exit. 1059 */ 1060 (void) task_wait(&term->wait, &texit, &retval); 1061 ui_quit(term->ui); 1062 return EOK; 1063 } 1064 1042 1065 /** @} 1043 1066 */ -
uspace/app/terminal/terminal.h
r24c452b3 rce862ac 38 38 #define TERMINAL_H 39 39 40 #include <adt/prodcons.h> 40 41 #include <errno.h> 42 #include <fibril.h> 41 43 #include <fibril_synch.h> 42 44 #include <gfx/bitmap.h> … … 46 48 #include <io/con_srv.h> 47 49 #include <loc.h> 48 #include <adt/prodcons.h>49 50 #include <stdatomic.h> 50 51 #include <str.h> 52 #include <task.h> 51 53 #include <ui/ui.h> 52 54 #include <ui/window.h> … … 91 93 service_id_t dsid; 92 94 con_srvs_t srvs; 95 96 task_wait_t wait; 97 fid_t wfid; 93 98 } terminal_t; 94 99
Note:
See TracChangeset
for help on using the changeset viewer.