]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/child.c
i3bar: add modelines to all files
[i3/i3] / i3bar / src / child.c
index ae0f47ee14feb5b1b75b27acab0cb822ae4d94a0..ff1bc8bb63922c94e14378767c92024969a78fc6 100644 (file)
@@ -1,4 +1,6 @@
 /*
+ * vim:ts=4:sw=4:expandtab
+ *
  * i3bar - an xcb-based status- and ws-bar for i3
  *
  * © 2010-2011 Axel Wagner and contributors
@@ -40,6 +42,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,9 +82,10 @@ 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;
+            draw_bars();
+            return;
         }
         rec += n;
 
@@ -110,7 +115,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();