mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-13 05:41:26 +01:00
reboot: Emulate nextboot -D better
It used to produce no output when the file couldn't be removed. Emulate
that better by unlinking and ignoring errors. It's used at the end of
reboot always, even when the file isn't going to be there.
Sponsored by: Netflix
Fixes: 2c47954811
This commit is contained in:
parent
c7d5cc6f5e
commit
07cba2ddcb
@ -288,8 +288,7 @@ main(int argc, char *argv[])
|
||||
errx(1, "-r and -k cannot be used together, there is no next kernel");
|
||||
|
||||
if (Dflag) {
|
||||
if (unlink(PATH_NEXTBOOT) != 0)
|
||||
err(1, "unlink %s", PATH_NEXTBOOT);
|
||||
(void)unlink(PATH_NEXTBOOT); /* Say nothing if it's not there */
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user