summaryrefslogtreecommitdiffstats
path: root/sbin/reboot/reboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/reboot/reboot.c')
-rw-r--r--sbin/reboot/reboot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c
index 6923640..0a52ba4 100644
--- a/sbin/reboot/reboot.c
+++ b/sbin/reboot/reboot.c
@@ -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);
OpenPOWER on IntegriCloud