diff options
author | 2018-10-23 10:12:32 +0100 | |
---|---|---|
committer | 2018-10-23 10:14:50 +0100 | |
commit | a9fdd5dd2adf1f09ff9df555e7342828abf1a654 (patch) | |
tree | bf0e7dbeb208b872738fe4068e3d7c06c19e9353 /sway | |
parent | Merge pull request #2940 from RyanDwyer/fix-swaybar-crash (diff) | |
download | sway-a9fdd5dd2adf1f09ff9df555e7342828abf1a654.tar.gz sway-a9fdd5dd2adf1f09ff9df555e7342828abf1a654.tar.zst sway-a9fdd5dd2adf1f09ff9df555e7342828abf1a654.zip |
commands: print correct command on error for exec and opacity
Diffstat (limited to 'sway')
-rw-r--r-- | sway/commands/exec_always.c | 8 | ||||
-rw-r--r-- | sway/commands/opacity.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index de78dd83..43b35dd7 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c | |||
@@ -16,7 +16,7 @@ | |||
16 | struct cmd_results *cmd_exec_always(int argc, char **argv) { | 16 | struct 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) return cmd_results_new(CMD_DEFER, NULL, NULL); | 18 | if (!config->active) return cmd_results_new(CMD_DEFER, NULL, NULL); |
19 | if ((error = checkarg(argc, "exec_always", EXPECTED_MORE_THAN, 0))) { | 19 | if ((error = checkarg(argc, argv[-1], EXPECTED_MORE_THAN, 0))) { |
20 | return error; | 20 | return error; |
21 | } | 21 | } |
22 | 22 | ||
@@ -24,7 +24,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
24 | if (strcmp(argv[0], "--no-startup-id") == 0) { | 24 | if (strcmp(argv[0], "--no-startup-id") == 0) { |
25 | wlr_log(WLR_INFO, "exec switch '--no-startup-id' not supported, ignored."); | 25 | wlr_log(WLR_INFO, "exec switch '--no-startup-id' not supported, ignored."); |
26 | --argc; ++argv; | 26 | --argc; ++argv; |
27 | if ((error = checkarg(argc, "exec_always", EXPECTED_MORE_THAN, 0))) { | 27 | if ((error = checkarg(argc, argv[-1], EXPECTED_MORE_THAN, 0))) { |
28 | return error; | 28 | return error; |
29 | } | 29 | } |
30 | } | 30 | } |
@@ -71,7 +71,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
71 | } else if (pid < 0) { | 71 | } else if (pid < 0) { |
72 | close(fd[0]); | 72 | close(fd[0]); |
73 | close(fd[1]); | 73 | close(fd[1]); |
74 | return cmd_results_new(CMD_FAILURE, "exec_always", "fork() failed"); | 74 | return cmd_results_new(CMD_FAILURE, argv[-1], "fork() failed"); |
75 | } | 75 | } |
76 | close(fd[1]); // close write | 76 | close(fd[1]); // close write |
77 | ssize_t s = 0; | 77 | ssize_t s = 0; |
@@ -85,7 +85,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) { | |||
85 | wlr_log(WLR_DEBUG, "Child process created with pid %d", child); | 85 | wlr_log(WLR_DEBUG, "Child process created with pid %d", child); |
86 | root_record_workspace_pid(child); | 86 | root_record_workspace_pid(child); |
87 | } else { | 87 | } else { |
88 | return cmd_results_new(CMD_FAILURE, "exec_always", | 88 | return cmd_results_new(CMD_FAILURE, argv[-1], |
89 | "Second fork() failed"); | 89 | "Second fork() failed"); |
90 | } | 90 | } |
91 | 91 | ||
diff --git a/sway/commands/opacity.c b/sway/commands/opacity.c index 4e4fc994..8c45b528 100644 --- a/sway/commands/opacity.c +++ b/sway/commands/opacity.c | |||
@@ -15,7 +15,7 @@ static bool parse_opacity(const char *opacity, float *val) { | |||
15 | 15 | ||
16 | struct cmd_results *cmd_opacity(int argc, char **argv) { | 16 | struct cmd_results *cmd_opacity(int argc, char **argv) { |
17 | struct cmd_results *error = NULL; | 17 | struct cmd_results *error = NULL; |
18 | if ((error = checkarg(argc, "layout", EXPECTED_EQUAL_TO, 1))) { | 18 | if ((error = checkarg(argc, "opacity", EXPECTED_EQUAL_TO, 1))) { |
19 | return error; | 19 | return error; |
20 | } | 20 | } |
21 | 21 | ||