Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/rndctl Overwrite the seed file from the beginning, usin...



details:   https://anonhg.NetBSD.org/src/rev/c636f5938038
branches:  trunk
changeset: 325997:c636f5938038
user:      apb <apb%NetBSD.org@localhost>
date:      Wed Jan 15 15:05:27 2014 +0000

description:
Overwrite the seed file from the beginning, using pwrite(2).

diffstat:

 sbin/rndctl/rndctl.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 72a8d9981f65 -r c636f5938038 sbin/rndctl/rndctl.c
--- a/sbin/rndctl/rndctl.c      Wed Jan 15 15:01:24 2014 +0000
+++ b/sbin/rndctl/rndctl.c      Wed Jan 15 15:05:27 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rndctl.c,v 1.26 2014/01/15 10:13:25 joerg Exp $        */
+/*     $NetBSD: rndctl.c,v 1.27 2014/01/15 15:05:27 apb Exp $  */
 
 /*-
  * Copyright (c) 1997 Michael Graff.
@@ -33,7 +33,7 @@
 #include <sha1.h>
 
 #ifndef lint
-__RCSID("$NetBSD: rndctl.c,v 1.26 2014/01/15 10:13:25 joerg Exp $");
+__RCSID("$NetBSD: rndctl.c,v 1.27 2014/01/15 15:05:27 apb Exp $");
 #endif
 
 
@@ -203,7 +203,7 @@
        }
 
        memset(&rszero, 0, sizeof(rszero));
-       if (write(fd, &rszero, sizeof(rszero)) != sizeof(rszero))
+       if (pwrite(fd, &rszero, sizeof(rszero), (off_t)0) != sizeof(rszero))
                err(1, "overwrite");
        fsync_range(fd, FDATASYNC|FDISKSYNC, (off_t)0, (off_t)0);
        close(fd);



Home | Main Index | Thread Index | Old Index