aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/exec_always.c
diff options
context:
space:
mode:
authorLibravatar M Stoeckl <code@mstoeckl.com>2019-01-10 18:27:21 -0500
committerLibravatar M Stoeckl <code@mstoeckl.com>2019-01-14 08:05:29 -0500
commit2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0 (patch)
tree56332b9c150459beb5aef94605372ef179ec8854 /sway/commands/exec_always.c
parentRemove 'input' field of IPC command return json (diff)
downloadsway-2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0.tar.gz
sway-2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0.tar.zst
sway-2a684cad5fc8e12a8e47a7fd00e2b7c66b43afb0.zip
Remove now-unused "input" argument of cmd_results_new
Patch tested by compiling with `__attribute__ ((format (printf, 2, 3)))` applied to `cmd_results_new`. String usage constants have been converted from pointers to arrays when encountered. General handler format strings were sometimes modified to include the old input string, especially for unknown command errors.
Diffstat (limited to 'sway/commands/exec_always.c')
-rw-r--r--sway/commands/exec_always.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c
index 9ec28d81..1ed6c7e6 100644
--- a/sway/commands/exec_always.c
+++ b/sway/commands/exec_always.c
@@ -15,7 +15,9 @@
15 15
16struct cmd_results *cmd_exec_always(int argc, char **argv) { 16struct cmd_results *cmd_exec_always(int argc, char **argv) {
17 struct cmd_results *error = NULL; 17 struct cmd_results *error = NULL;
18 if (!config->active || config->validating) return cmd_results_new(CMD_DEFER, NULL, NULL); 18 if (!config->active || config->validating) {
19 return cmd_results_new(CMD_DEFER, NULL);
20 }
19 if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) { 21 if ((error = checkarg(argc, argv[-1], EXPECTED_AT_LEAST, 1))) {
20 return error; 22 return error;
21 } 23 }
@@ -71,7 +73,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
71 } else if (pid < 0) { 73 } else if (pid < 0) {
72 close(fd[0]); 74 close(fd[0]);
73 close(fd[1]); 75 close(fd[1]);
74 return cmd_results_new(CMD_FAILURE, argv[-1], "fork() failed"); 76 return cmd_results_new(CMD_FAILURE, "fork() failed");
75 } 77 }
76 close(fd[1]); // close write 78 close(fd[1]); // close write
77 ssize_t s = 0; 79 ssize_t s = 0;
@@ -85,9 +87,8 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
85 wlr_log(WLR_DEBUG, "Child process created with pid %d", child); 87 wlr_log(WLR_DEBUG, "Child process created with pid %d", child);
86 root_record_workspace_pid(child); 88 root_record_workspace_pid(child);
87 } else { 89 } else {
88 return cmd_results_new(CMD_FAILURE, argv[-1], 90 return cmd_results_new(CMD_FAILURE, "Second fork() failed");
89 "Second fork() failed");
90 } 91 }
91 92
92 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 93 return cmd_results_new(CMD_SUCCESS, NULL);
93} 94}