From owner-svn-src-head@freebsd.org Fri Aug 17 14:57:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4454107166F; Fri, 17 Aug 2018 14:57:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74C4481A88; Fri, 17 Aug 2018 14:57:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D8D01E34; Fri, 17 Aug 2018 14:57:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7HEvESY073832; Fri, 17 Aug 2018 14:57:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7HEvEx1073831; Fri, 17 Aug 2018 14:57:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201808171457.w7HEvEx1073831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 17 Aug 2018 14:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337968 - head/sbin/init X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sbin/init X-SVN-Commit-Revision: 337968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Aug 2018 14:57:14 -0000 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 */