aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/exec_always.c
diff options
context:
space:
mode:
authorLibravatar Rostislav Pehlivanov <atomnuker@gmail.com>2018-05-06 00:19:29 +0100
committerLibravatar Rostislav Pehlivanov <atomnuker@gmail.com>2018-05-06 00:19:29 +0100
commitcf602687c6c77b3292370d0639ab5080b7fd611b (patch)
treeb04309baea89e0cff94d591f5c809c415186827e /sway/commands/exec_always.c
parentRevert "security.d: Update install paths for swaybar and swaybg" (diff)
downloadsway-cf602687c6c77b3292370d0639ab5080b7fd611b.tar.gz
sway-cf602687c6c77b3292370d0639ab5080b7fd611b.tar.zst
sway-cf602687c6c77b3292370d0639ab5080b7fd611b.zip
Revert "command/exec_always: Use wlr_log for logging errors in the child process"
Diffstat (limited to 'sway/commands/exec_always.c')
-rw-r--r--sway/commands/exec_always.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c
index f631d7d8..1d95dc96 100644
--- a/sway/commands/exec_always.c
+++ b/sway/commands/exec_always.c
@@ -11,7 +11,6 @@
11#include "log.h" 11#include "log.h"
12#include "stringop.h" 12#include "stringop.h"
13 13
14
15struct cmd_results *cmd_exec_always(int argc, char **argv) { 14struct cmd_results *cmd_exec_always(int argc, char **argv) {
16 struct cmd_results *error = NULL; 15 struct cmd_results *error = NULL;
17 if (!config->active) return cmd_results_new(CMD_DEFER, NULL, NULL); 16 if (!config->active) return cmd_results_new(CMD_DEFER, NULL, NULL);
@@ -63,8 +62,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
63 size_t n = confstr(_CS_PATH, NULL, 0); 62 size_t n = confstr(_CS_PATH, NULL, 0);
64 path = malloc(n + extra_size); 63 path = malloc(n + extra_size);
65 if (!path) { 64 if (!path) {
66 wlr_log(L_ERROR, "exec_always: Unable to allocate PATH"); 65 return cmd_results_new(CMD_FAILURE, "exec_always", "Unable to allocate PATH");
67 exit(EXIT_FAILURE);
68 } 66 }
69 confstr(_CS_PATH, path, n); 67 confstr(_CS_PATH, path, n);
70 68
@@ -72,8 +70,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
72 size_t n = strlen(path) + 1; 70 size_t n = strlen(path) + 1;
73 char *tmp = malloc(n + extra_size); 71 char *tmp = malloc(n + extra_size);
74 if (!tmp) { 72 if (!tmp) {
75 wlr_log(L_ERROR, "exec_always: Unable to allocate PATH"); 73 return cmd_results_new(CMD_FAILURE, "exec_always", "Unable to allocate PATH");
76 exit(EXIT_FAILURE);
77 } 74 }
78 75
79 strncpy(tmp, path, n); 76 strncpy(tmp, path, n);
@@ -84,8 +81,7 @@ struct cmd_results *cmd_exec_always(int argc, char **argv) {
84 strcat(path, extra_path); 81 strcat(path, extra_path);
85 if (setenv("PATH", path, 1) == -1) { 82 if (setenv("PATH", path, 1) == -1) {
86 free(path); 83 free(path);
87 wlr_log(L_ERROR, "exec_always: Unable to set PATH"); 84 return cmd_results_new(CMD_FAILURE, "exec_always", "Unable to set PATH");
88 exit(EXIT_FAILURE);
89 } 85 }
90 free(path); 86 free(path);
91 87