summaryrefslogtreecommitdiff
path: root/sbin/clri
diff options
context:
space:
mode:
authornatano <natano@cvs.openbsd.org>2016-03-07 21:47:05 +0000
committernatano <natano@cvs.openbsd.org>2016-03-07 21:47:05 +0000
commit13b1316938a89d6f72c8a68d61f279dde7d353a0 (patch)
tree27bc50dd285eae0d19a9f9a83946751a7e06cd11 /sbin/clri
parent794c18cd74e4b77203ff8b508071cb455cfca988 (diff)
Use opendev() instead of a plain open().
ok deraadt
Diffstat (limited to 'sbin/clri')
-rw-r--r--sbin/clri/Makefile5
-rw-r--r--sbin/clri/clri.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/sbin/clri/Makefile b/sbin/clri/Makefile
index 9b870e2beba..8be41f8662f 100644
--- a/sbin/clri/Makefile
+++ b/sbin/clri/Makefile
@@ -1,6 +1,9 @@
-# $OpenBSD: Makefile,v 1.3 1997/09/21 11:36:09 deraadt Exp $
+# $OpenBSD: Makefile,v 1.4 2016/03/07 21:47:04 natano Exp $
PROG= clri
MAN= clri.8
+DPADD= ${LIBUTIL}
+LDADD= -lutil
+
.include <bsd.prog.mk>
diff --git a/sbin/clri/clri.c b/sbin/clri/clri.c
index 23a3ac0a87a..972796a19a6 100644
--- a/sbin/clri/clri.c
+++ b/sbin/clri/clri.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clri.c,v 1.18 2015/11/03 04:47:55 mmcc Exp $ */
+/* $OpenBSD: clri.c,v 1.19 2016/03/07 21:47:04 natano Exp $ */
/* $NetBSD: clri.c,v 1.19 2005/01/20 15:50:47 xtraeme Exp $ */
/*
@@ -44,6 +44,7 @@
#include <string.h>
#include <stdio.h>
#include <unistd.h>
+#include <util.h>
/*
* Possible superblock locations ordered from most to least likely.
@@ -76,7 +77,7 @@ main(int argc, char *argv[])
sbp = NULL;
/* get the superblock. */
- if ((fd = open(fs, O_RDWR, 0)) < 0)
+ if ((fd = opendev(fs, O_RDWR, 0, NULL)) < 0)
err(1, "%s", fs);
if (pledge("stdio", NULL) == -1)