mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Truncate nextboot.conf file on creation, so existing garbage will be removed.
Submitted by: Gary Allan <dragonfly@gallan.plus.com> Obtained from: DragonFlyBSD MFC after: 3 days
This commit is contained in:
parent
ab7f22e264
commit
3edf7a78b7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=143948
|
@ -117,7 +117,8 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
if (kernel != NULL) {
|
||||
fd = open("/boot/nextboot.conf", O_WRONLY | O_CREAT, 0444);
|
||||
fd = open("/boot/nextboot.conf", O_WRONLY | O_CREAT | O_TRUNC,
|
||||
0444);
|
||||
if (fd > -1) {
|
||||
(void)write(fd, "nextboot_enable=\"YES\"\n", 22);
|
||||
(void)write(fd, "kernel=\"", 8L);
|
||||
|
|
Loading…
Reference in a new issue