Fix condition for detecting read failure in process_child_status().
authorDavin McCall <davmac@davmac.org>
Sun, 12 Jun 2016 23:18:57 +0000 (00:18 +0100)
committerDavin McCall <davmac@davmac.org>
Sun, 12 Jun 2016 23:18:57 +0000 (00:18 +0100)
src/service.cc

index 5827e23a313cc8084cf38d25020c9517934b5e4b..7dd8cb14a176c1d7eb378977b0a8d08dbe753dc5 100644 (file)
@@ -230,7 +230,7 @@ void ServiceRecord::process_child_status(EventLoop_t *loop, ServiceIoWatcher * s
     close(stat_io->fd);
     stat_io->deregisterWatch(loop);
     
-    if (r != 0) {
+    if (r > 0) {
         // We read an errno code; exec() failed, and the service startup failed.
         sr->pid = -1;
         log(LogLevel::ERROR, sr->service_name, ": execution failed: ", strerror(exec_status));