Revision 2259 libsylph/utils.c
| utils.c (revision 2259) | ||
|---|---|---|
| 3875 | 3875 |
CmdData *cmd_data = (CmdData *)data; |
| 3876 | 3876 |
gchar **argv; |
| 3877 | 3877 |
|
| 3878 |
g_print("execute_command_line_async_func\n");
|
|
| 3879 | 3878 |
argv = strsplit_with_quote(cmd_data->cmdline, " ", 0); |
| 3880 | 3879 |
cmd_data->status = execute_sync(argv); |
| 3881 | 3880 |
g_strfreev(argv); |
| 3882 | 3881 |
|
| 3883 |
g_print("execute_command_line_async_func: exec done.\n");
|
|
| 3882 |
debug_print("execute_command_line_async_func: exec done: %s\n",
|
|
| 3883 |
cmd_data->cmdline); |
|
| 3884 | 3884 |
cmd_data->flag = 1; |
| 3885 | 3885 |
g_main_context_wakeup(NULL); |
| 3886 | 3886 |
|
| 3887 |
g_print("execute_command_line_async_func: exiting\n");
|
|
| 3888 | 3887 |
return GINT_TO_POINTER(0); |
| 3889 | 3888 |
} |
| 3890 | 3889 |
|
| ... | ... | |
| 3909 | 3908 |
if (!thread) |
| 3910 | 3909 |
return -1; |
| 3911 | 3910 |
|
| 3912 |
g_print("execute_command_line_async_wait: waiting thread\n");
|
|
| 3911 |
debug_print("execute_command_line_async_wait: waiting thread\n");
|
|
| 3913 | 3912 |
while (data.flag == 0) |
| 3914 | 3913 |
event_loop_iterate(); |
| 3915 | 3914 |
|
| 3916 |
g_print("execute_command_line_async_wait: flagged\n");
|
|
| 3915 |
debug_print("execute_command_line_async_wait: flagged\n");
|
|
| 3917 | 3916 |
g_thread_join(thread); |
| 3918 |
g_print("execute_command_line_async_wait: thread exited\n");
|
|
| 3917 |
debug_print("execute_command_line_async_wait: thread exited\n");
|
|
| 3919 | 3918 |
|
| 3920 | 3919 |
return data.status; |
| 3921 | 3920 |
} |
Also available in: Unified diff