]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
main: no need to set errno manually 2636/head
authorAlexander Kuleshov <kuleshovmail@gmail.com>
Tue, 16 Feb 2016 12:42:45 +0000 (18:42 +0600)
committerAlexander Kuleshov <kuleshovmail@gmail.com>
Tue, 16 Feb 2016 12:56:15 +0000 (18:56 +0600)
If we are not PID 1 and started as init, we executing systemctl
with execv(). Here no need to set errno manually, because in a
failure case, because the execv() anyway will set errno depends
on a error.

src/core/main.c

index e2088574c05a656cbfc8bceaece519364fb66887..c725a686f1d292a8f34808ae5f8d0a7121a7a8e2 100644 (file)
@@ -1313,7 +1313,6 @@ int main(int argc, char *argv[]) {
                 /* This is compatibility support for SysV, where
                  * calling init as a user is identical to telinit. */
 
-                errno = -ENOENT;
                 execv(SYSTEMCTL_BINARY_PATH, argv);
                 log_error_errno(errno, "Failed to exec " SYSTEMCTL_BINARY_PATH ": %m");
                 return 1;