Changeset ce862ac in mainline for uspace/app/terminal/terminal.c
- Timestamp:
- 2021-11-02T18:49:52Z (2 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b48e680f
- Parents:
- 24c452b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 */
Note:
See TracChangeset
for help on using the changeset viewer.