From: Alexander Kuleshov Date: Tue, 16 Feb 2016 12:42:45 +0000 (+0600) Subject: main: no need to set errno manually X-Git-Tag: v230~353^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9f65a60c28d191bb9bbd5668593e56885250644;p=thirdparty%2Fsystemd.git main: no need to set errno manually 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. --- diff --git a/src/core/main.c b/src/core/main.c index e2088574c05..c725a686f1d 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -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;