Let reboot(8) use getprogname() to compare the program name.
While there, mark the global variable dohalt static, as reboot(8) only consists of a single C file.
This commit is contained in:
parent
38db8319a9
commit
f30d5ac5ec
@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
|
||||
static void usage(void);
|
||||
static u_int get_pageins(void);
|
||||
|
||||
int dohalt;
|
||||
static int dohalt;
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
@ -69,9 +69,9 @@ main(int argc, char *argv[])
|
||||
const struct passwd *pw;
|
||||
int ch, howto, i, fd, lflag, nflag, qflag, sverrno;
|
||||
u_int pageins;
|
||||
const char *p, *user, *kernel = NULL;
|
||||
const char *user, *kernel = NULL;
|
||||
|
||||
if (strstr((p = rindex(*argv, '/')) ? p + 1 : *argv, "halt")) {
|
||||
if (strcmp(getprogname(), "halt") == 0) {
|
||||
dohalt = 1;
|
||||
howto = RB_HALT;
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user