From: Michael Stapelberg Date: Thu, 25 Aug 2011 15:10:45 +0000 (+0200) Subject: Bugfix: set statusline = NULL, print error messages about EOF/SIGCHLD to stderr ... X-Git-Tag: 4.0.2~22^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9c587a767c78d0ec166b5e8674c5d3be42df4d98;p=i3%2Fi3 Bugfix: set statusline = NULL, print error messages about EOF/SIGCHLD to stderr (Thanks cls) --- diff --git a/i3bar/src/child.c b/i3bar/src/child.c index 3f59d060..1662dbd2 100644 --- a/i3bar/src/child.c +++ b/i3bar/src/child.c @@ -40,6 +40,8 @@ void cleanup() { ev_io_stop(main_loop, stdin_io); FREE(stdin_io); FREE(statusline_buffer); + /* statusline pointed to memory within statusline_buffer */ + statusline = NULL; } if (child_sig != NULL) { @@ -78,7 +80,7 @@ void stdin_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) { } /* end of file, kill the watcher */ - DLOG("stdin: EOF\n"); + ELOG("stdin: received EOF\n"); cleanup(); break; } @@ -110,7 +112,7 @@ void stdin_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) { * */ void child_sig_cb(struct ev_loop *loop, ev_child *watcher, int revents) { - DLOG("Child (pid: %d) unexpectedly exited with status %d\n", + ELOG("Child (pid: %d) unexpectedly exited with status %d\n", child_pid, watcher->rstatus); cleanup();