summaryrefslogtreecommitdiffstats
path: root/usr.sbin/installboot/sparc64_installboot.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2015-12-28 23:00:29 +0000
committerkrw <krw@openbsd.org>2015-12-28 23:00:29 +0000
commitc462e017e735f5be1ed8c4531e1a532d87cf44f6 (patch)
treedc1103d7619958c36ec1c7c5cbc67d1dfe70f88d /usr.sbin/installboot/sparc64_installboot.c
parentRemove NULL-checks before free() and unnecessary argument casts. (diff)
downloadwireguard-openbsd-c462e017e735f5be1ed8c4531e1a532d87cf44f6.tar.xz
wireguard-openbsd-c462e017e735f5be1ed8c4531e1a532d87cf44f6.zip
Replace lseek/[read|write] with pread|pwrite.
ok millert@ a while ago.
Diffstat (limited to 'usr.sbin/installboot/sparc64_installboot.c')
-rw-r--r--usr.sbin/installboot/sparc64_installboot.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/installboot/sparc64_installboot.c b/usr.sbin/installboot/sparc64_installboot.c
index bea18878dd0..1932476cb29 100644
--- a/usr.sbin/installboot/sparc64_installboot.c
+++ b/usr.sbin/installboot/sparc64_installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sparc64_installboot.c,v 1.6 2015/11/30 17:34:57 jsing Exp $ */
+/* $OpenBSD: sparc64_installboot.c,v 1.7 2015/12/28 23:00:29 krw Exp $ */
/*
* Copyright (c) 2012, 2013 Joel Sing <jsing@openbsd.org>
@@ -103,13 +103,11 @@ md_installboot(int devfd, char *dev)
exit(1);
/* Write bootblock into the superblock. */
- if (lseek(devfd, DEV_BSIZE, SEEK_SET) != DEV_BSIZE)
- err(1, "lseek");
if (verbose)
fprintf(stderr, "%s boot block to disk %s\n",
(nowrite ? "would write" : "writing"), dev);
if (nowrite)
return;
- if (write(devfd, blkstore, blksize) != (ssize_t)blksize)
- err(1, "write");
+ if (pwrite(devfd, blkstore, blksize, DEV_BSIZE) != (ssize_t)blksize)
+ err(1, "pwrite");
}