svn commit: r337968 - head/sbin/init
Edward Tomasz Napierala
trasz at FreeBSD.org
Fri Aug 17 14:57:14 UTC 2018
Author: trasz
Date: Fri Aug 17 14:57:13 2018
New Revision: 337968
URL: https://svnweb.freebsd.org/changeset/base/337968
Log:
Consistently use NULL to terminate the argv; no functional changes.
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Modified:
head/sbin/init/init.c
Modified: head/sbin/init/init.c
==============================================================================
--- head/sbin/init/init.c Fri Aug 17 14:47:21 2018 (r337967)
+++ head/sbin/init/init.c Fri Aug 17 14:57:13 2018 (r337968)
@@ -974,7 +974,7 @@ single_user(void)
char name[] = "-sh";
argv[0] = name;
- argv[1] = 0;
+ argv[1] = NULL;
execv(shell, argv);
emergency("can't exec %s for single user: %m", shell);
execv(_PATH_BSHELL, argv);
@@ -1134,7 +1134,7 @@ run_script(const char *script)
argv[0] = _sh;
argv[1] = __DECONST(char *, script);
argv[2] = runcom_mode == AUTOBOOT ? _autoboot : 0;
- argv[3] = 0;
+ argv[3] = NULL;
execute_script(argv);
sleep(STALL_TIMEOUT);
@@ -1478,10 +1478,10 @@ start_window_system(session_t *sp)
strcpy(term, "TERM=");
strlcat(term, sp->se_type, sizeof(term));
env[0] = term;
- env[1] = 0;
+ env[1] = NULL;
}
else
- env[0] = 0;
+ env[0] = NULL;
execve(sp->se_window_argv[0], sp->se_window_argv, env);
stall("can't exec window system '%s' for port %s: %m",
sp->se_window_argv[0], sp->se_device);
@@ -1542,9 +1542,9 @@ start_getty(session_t *sp)
strcpy(term, "TERM=");
strlcat(term, sp->se_type, sizeof(term));
env[0] = term;
- env[1] = 0;
+ env[1] = NULL;
} else
- env[0] = 0;
+ env[0] = NULL;
execve(sp->se_getty_argv[0], sp->se_getty_argv, env);
stall("can't exec getty '%s' for port %s: %m",
sp->se_getty_argv[0], sp->se_device);
@@ -1928,7 +1928,7 @@ runshutdown(void)
argv[0] = _sh;
argv[1] = _path_rundown;
argv[2] = Reboot ? _reboot : _single;
- argv[3] = 0;
+ argv[3] = NULL;
execute_script(argv);
_exit(1); /* force single user mode */
More information about the svn-src-all
mailing list