]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: add error message when we get unexpected event from waitid()
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Apr 2016 15:41:48 +0000 (17:41 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 12 Apr 2016 11:43:32 +0000 (13:43 +0200)
We should log about everything we don't expect.

Also, add a comment for one case were we do not log, on purpose, and make it
use a separate error code.

src/systemctl/systemctl.c

index d3e9ccfbd51a83a71b3eb5778efb9d6f7ad3fec9..7c259ba06f1fcde948eed075b8dbb061fabe0d65 100644 (file)
@@ -5340,9 +5340,11 @@ static int enable_sysv_units(const char *verb, char **args) {
                                 }
 
                         } else if (status.si_status != 0)
-                                return -EINVAL;
-                } else
+                                return -EBADE; /* We don't warn here, under the assumption the script already showed an explanation */
+                } else {
+                        log_error("Unexpected waitid() result.");
                         return -EPROTO;
+                }
 
                 if (found_native)
                         continue;
@@ -5413,8 +5415,7 @@ static int enable_unit(int argc, char *argv[], void *userdata) {
         if (r < 0)
                 return r;
 
-        /* If the operation was fully executed by the SysV compat,
-         * let's finish early */
+        /* If the operation was fully executed by the SysV compat, let's finish early */
         if (strv_isempty(names))
                 return 0;