Skip to content

Commit b9f65a6

Browse files
committed
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.
1 parent 6043679 commit b9f65a6

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/core/main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,6 @@ int main(int argc, char *argv[]) {
13131313
/* This is compatibility support for SysV, where
13141314
* calling init as a user is identical to telinit. */
13151315

1316-
errno = -ENOENT;
13171316
execv(SYSTEMCTL_BINARY_PATH, argv);
13181317
log_error_errno(errno, "Failed to exec " SYSTEMCTL_BINARY_PATH ": %m");
13191318
return 1;

0 commit comments

Comments
 (0)