aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2005-03-24 16:03:54 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2005-03-24 16:03:54 +0000
commit4a2f17d661e25199105f81129310eae1f3a111a3 (patch)
treed69e0a9fae06b5911b1b8538215bf2e0850f1d9a /sbin
parent63ba8a983c1c29706e9685516298e3b534c1a9e3 (diff)
Notes
Diffstat (limited to 'sbin')
-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 9bc866a065ca6..3d9d7f348c86d 100644
--- a/sbin/reboot/reboot.c
+++ b/sbin/reboot/reboot.c
@@ -119,7 +119,8 @@ main(int argc, char *argv[])
}
if (kflag) {
- 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);