mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-28 03:42:04 +01:00
nextboot: check unlink, but only warn on !ENOENT
Emulate rm -f from the nextboot.sh script: Report all errors, except ENOENT. This problems show through, except the expected one when nextboot.conf isn't there. Sponsored by: Netflix Reviewed by: rew Differential Revision: https://reviews.freebsd.org/D44013
This commit is contained in:
parent
99fa799a19
commit
bad90cb4f6
@ -288,7 +288,8 @@ main(int argc, char *argv[])
|
||||
errx(1, "-r and -k cannot be used together, there is no next kernel");
|
||||
|
||||
if (Dflag) {
|
||||
(void)unlink(PATH_NEXTBOOT); /* Say nothing if it's not there */
|
||||
if (unlink(PATH_NEXTBOOT) != 0 && errno != ENOENT)
|
||||
warn("unlink " PATH_NEXTBOOT);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user