diff options
author | emersion <contact@emersion.fr> | 2018-07-09 22:54:30 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-07-09 22:54:30 +0100 |
commit | 63b4bf500020cf35cebfdce2d73f8e359ff495c2 (patch) | |
tree | 76624b3d4820551261e5c15f773c403c1a41264e /sway/config/bar.c | |
parent | Merge pull request #2223 from RyanDwyer/floating-move (diff) | |
download | sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.gz sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.tar.zst sway-63b4bf500020cf35cebfdce2d73f8e359ff495c2.zip |
Update for swaywm/wlroots#1126
Diffstat (limited to 'sway/config/bar.c')
-rw-r--r-- | sway/config/bar.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sway/config/bar.c b/sway/config/bar.c index ee062c6a..3a74331e 100644 --- a/sway/config/bar.c +++ b/sway/config/bar.c | |||
@@ -16,10 +16,10 @@ | |||
16 | #include "log.h" | 16 | #include "log.h" |
17 | 17 | ||
18 | static void terminate_swaybar(pid_t pid) { | 18 | static void terminate_swaybar(pid_t pid) { |
19 | wlr_log(L_DEBUG, "Terminating swaybar %d", pid); | 19 | wlr_log(WLR_DEBUG, "Terminating swaybar %d", pid); |
20 | int ret = kill(-pid, SIGTERM); | 20 | int ret = kill(-pid, SIGTERM); |
21 | if (ret != 0) { | 21 | if (ret != 0) { |
22 | wlr_log_errno(L_ERROR, "Unable to terminate swaybar %d", pid); | 22 | wlr_log_errno(WLR_ERROR, "Unable to terminate swaybar %d", pid); |
23 | } else { | 23 | } else { |
24 | int status; | 24 | int status; |
25 | waitpid(pid, &status, 0); | 25 | waitpid(pid, &status, 0); |
@@ -167,7 +167,7 @@ void invoke_swaybar(struct bar_config *bar) { | |||
167 | // Pipe to communicate errors | 167 | // Pipe to communicate errors |
168 | int filedes[2]; | 168 | int filedes[2]; |
169 | if (pipe(filedes) == -1) { | 169 | if (pipe(filedes) == -1) { |
170 | wlr_log(L_ERROR, "Pipe setup failed! Cannot fork into bar"); | 170 | wlr_log(WLR_ERROR, "Pipe setup failed! Cannot fork into bar"); |
171 | return; | 171 | return; |
172 | } | 172 | } |
173 | 173 | ||
@@ -197,17 +197,17 @@ void invoke_swaybar(struct bar_config *bar) { | |||
197 | execvp(cmd[0], cmd); | 197 | execvp(cmd[0], cmd); |
198 | exit(1); | 198 | exit(1); |
199 | } | 199 | } |
200 | wlr_log(L_DEBUG, "Spawned swaybar %d", bar->pid); | 200 | wlr_log(WLR_DEBUG, "Spawned swaybar %d", bar->pid); |
201 | close(filedes[0]); | 201 | close(filedes[0]); |
202 | size_t len; | 202 | size_t len; |
203 | if (read(filedes[1], &len, sizeof(size_t)) == sizeof(size_t)) { | 203 | if (read(filedes[1], &len, sizeof(size_t)) == sizeof(size_t)) { |
204 | char *buf = malloc(len); | 204 | char *buf = malloc(len); |
205 | if(!buf) { | 205 | if(!buf) { |
206 | wlr_log(L_ERROR, "Cannot allocate error string"); | 206 | wlr_log(WLR_ERROR, "Cannot allocate error string"); |
207 | return; | 207 | return; |
208 | } | 208 | } |
209 | if (read(filedes[1], buf, len)) { | 209 | if (read(filedes[1], buf, len)) { |
210 | wlr_log(L_ERROR, "%s", buf); | 210 | wlr_log(WLR_ERROR, "%s", buf); |
211 | } | 211 | } |
212 | free(buf); | 212 | free(buf); |
213 | } | 213 | } |
@@ -244,7 +244,7 @@ void load_swaybars() { | |||
244 | if (bar->pid != 0) { | 244 | if (bar->pid != 0) { |
245 | terminate_swaybar(bar->pid); | 245 | terminate_swaybar(bar->pid); |
246 | } | 246 | } |
247 | wlr_log(L_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); | 247 | wlr_log(WLR_DEBUG, "Invoking swaybar for bar id '%s'", bar->id); |
248 | invoke_swaybar(bar); | 248 | invoke_swaybar(bar); |
249 | } | 249 | } |
250 | } | 250 | } |