diff options
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/exec_always.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index 0d3254ae..13deb9e3 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c | |||
@@ -53,6 +53,7 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) { | |||
53 | } | 53 | } |
54 | 54 | ||
55 | pid_t pid, child; | 55 | pid_t pid, child; |
56 | struct launcher_ctx *ctx = launcher_ctx_create(); | ||
56 | // Fork process | 57 | // Fork process |
57 | if ((pid = fork()) == 0) { | 58 | if ((pid = fork()) == 0) { |
58 | // Fork child process again | 59 | // Fork child process again |
@@ -92,8 +93,12 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) { | |||
92 | waitpid(pid, NULL, 0); | 93 | waitpid(pid, NULL, 0); |
93 | if (child > 0) { | 94 | if (child > 0) { |
94 | sway_log(SWAY_DEBUG, "Child process created with pid %d", child); | 95 | sway_log(SWAY_DEBUG, "Child process created with pid %d", child); |
95 | launcher_ctx_create(child); | 96 | if (ctx != NULL) { |
97 | sway_log(SWAY_DEBUG, "Recording workspace for process %d", child); | ||
98 | ctx->pid = child; | ||
99 | } | ||
96 | } else { | 100 | } else { |
101 | launcher_ctx_destroy(ctx); | ||
97 | return cmd_results_new(CMD_FAILURE, "Second fork() failed"); | 102 | return cmd_results_new(CMD_FAILURE, "Second fork() failed"); |
98 | } | 103 | } |
99 | 104 | ||