diff options
author | Alexander Hall <halex@cvs.openbsd.org> | 2011-02-28 00:12:20 +0000 |
---|---|---|
committer | Alexander Hall <halex@cvs.openbsd.org> | 2011-02-28 00:12:20 +0000 |
commit | 398536665c473589e9721db24814ccd3e9672a3b (patch) | |
tree | efd1a96145f7d3d585d110c5150573db9c752a98 /sbin | |
parent | 38e8ee5f5e0438c522c36b78fbed5df3b0b245d2 (diff) |
switch open(...) to opendev(...)
makes yet another utility honor DUID's
ok jsing@ miod@ deraadt@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dumpfs/Makefile | 5 | ||||
-rw-r--r-- | sbin/dumpfs/dumpfs.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sbin/dumpfs/Makefile b/sbin/dumpfs/Makefile index 5875e80bddd..3c2c70d2d69 100644 --- a/sbin/dumpfs/Makefile +++ b/sbin/dumpfs/Makefile @@ -1,6 +1,9 @@ -# $OpenBSD: Makefile,v 1.3 1997/09/21 11:36:20 deraadt Exp $ +# $OpenBSD: Makefile,v 1.4 2011/02/28 00:12:19 halex Exp $ PROG= dumpfs MAN= dumpfs.8 +LDADD= -lutil +DPADD= ${LIBUTIL} + .include <bsd.prog.mk> diff --git a/sbin/dumpfs/dumpfs.c b/sbin/dumpfs/dumpfs.c index 93904c1f191..86b7afe604d 100644 --- a/sbin/dumpfs/dumpfs.c +++ b/sbin/dumpfs/dumpfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dumpfs.c,v 1.27 2009/10/27 23:59:32 deraadt Exp $ */ +/* $OpenBSD: dumpfs.c,v 1.28 2011/02/28 00:12:19 halex Exp $ */ /* * Copyright (c) 2002 Networks Associates Technology, Inc. @@ -52,6 +52,7 @@ #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <util.h> union { struct fs fs; @@ -70,7 +71,7 @@ long dev_bsize; int dumpfs(int, const char *); int dumpcg(const char *, int, int); int marshal(const char *); -int open_disk(const char *name); +int open_disk(const char *); void pbits(void *, int); __dead void usage(void); @@ -124,7 +125,7 @@ open_disk(const char *name) ssize_t n; /* XXX - should retry w/raw device on failure */ - if ((fd = open(name, O_RDONLY, 0)) < 0) { + if ((fd = opendev(name, O_RDONLY, 0, NULL)) < 0) { warn("%s", name); return(-1); } |