summaryrefslogtreecommitdiff
path: root/sbin/fdisk/fdisk.c
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-06-17 08:27:27 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-06-17 08:27:27 +0000
commitdf1b0a5d93b83bf318a7669ab80f477a8a8c9eb6 (patch)
treed08d046c93340da77210842bfb4fee03e6424821 /sbin/fdisk/fdisk.c
parent12f85156d0938b800c7821b3760aad5496ee3c1e (diff)
Switched to generic opendev(3)
Diffstat (limited to 'sbin/fdisk/fdisk.c')
-rw-r--r--sbin/fdisk/fdisk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c
index ce378a35eab..46e7b44bec7 100644
--- a/sbin/fdisk/fdisk.c
+++ b/sbin/fdisk/fdisk.c
@@ -1,3 +1,4 @@
+/* $OpenBSD */
/* $NetBSD: fdisk.c,v 1.11 1995/10/04 23:11:19 ghudson Exp $ */
/*
@@ -42,6 +43,7 @@ static char rcsid[] = "$NetBSD: fdisk.c,v 1.11 1995/10/04 23:11:19 ghudson Exp $
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <util.h>
#define LBUF 100
static char lbuf[LBUF];
@@ -595,7 +597,8 @@ open_disk(u_flag)
{
struct stat st;
- if ((fd = open(disk, u_flag ? O_RDWR : O_RDONLY)) == -1) {
+ fd = opendev(disk, (u_flag ? O_RDWR : O_RDONLY), OPENDEV_PART, &disk);
+ if (fd == -1) {
warn("%s", disk);
return (-1);
}