mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-18 02:19:39 +00:00
Consistently use NULL to terminate the argv; no functional changes.
MFC after: 2 weeks Sponsored by: DARPA, AFRL
This commit is contained in:
parent
62ee5bbd73
commit
be03cfdd75
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337968
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user