From 0722d7a48e56b96c9834940ffdd804ac05877a4c Mon Sep 17 00:00:00 2001 From: downsj <> Date: Mon, 23 Dec 1996 07:43:42 +0000 Subject: [PATCH] readlabelfs() takes two arguments now, update prototype, inc major number. --- src/lib/libutil/readlabel.c | 23 +++++++++++++++-------- src/lib/libutil/shlib_version | 4 ++-- src/lib/libutil/util.h | 4 ++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/lib/libutil/readlabel.c b/src/lib/libutil/readlabel.c index 803fbffc..906d6ba1 100644 --- a/src/lib/libutil/readlabel.c +++ b/src/lib/libutil/readlabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readlabel.c,v 1.2 1996/12/04 21:25:33 downsj Exp $ */ +/* $OpenBSD: readlabel.c,v 1.3 1996/12/23 07:43:42 downsj Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. @@ -44,8 +44,9 @@ * style filesystem type name for the specified partition. */ -char *readlabelfs(device) +char *readlabelfs(device, verbose) char *device; + int verbose; { char rpath[MAXPATHLEN]; char part, *type; @@ -55,7 +56,8 @@ char *readlabelfs(device) /* Assuming device is of the form /dev/??p, build a raw partition. */ if (stat(device, &sbuf) < 0) { - warn("%s", device); + if (verbose) + warn("%s", device); return(NULL); } switch(sbuf.st_mode & S_IFMT) { @@ -79,7 +81,8 @@ char *readlabelfs(device) break; } default: - warnx("%s: not a device node", device); + if (verbose) + warnx("%s: not a device node", device); return(NULL); } @@ -91,23 +94,27 @@ char *readlabelfs(device) fd = open(rpath, O_RDONLY); if (fd < 0) { - warn("%s", rpath); + if (verbose) + warn("%s", rpath); return(NULL); } } else { - warn("%s", rpath); + if (verbose) + warn("%s", rpath); return(NULL); } } if (ioctl(fd, DIOCGDINFO, &dk) < 0) { - warn("%s: couldn't read disklabel", rpath); + if (verbose) + warn("%s: couldn't read disklabel", rpath); close(fd); return(NULL); } close(fd); if (dk.d_partitions[part - 'a'].p_fstype > FSMAXTYPES) { - warnx("%s: bad filesystem type in label", rpath); + if (verbose) + warnx("%s: bad filesystem type in label", rpath); return(NULL); } diff --git a/src/lib/libutil/shlib_version b/src/lib/libutil/shlib_version index b25072f4..d9961ea9 100644 --- a/src/lib/libutil/shlib_version +++ b/src/lib/libutil/shlib_version @@ -1,2 +1,2 @@ -major=3 -minor=3 +major=4 +minor=0 diff --git a/src/lib/libutil/util.h b/src/lib/libutil/util.h index 6206c8a1..1466cdee 100644 --- a/src/lib/libutil/util.h +++ b/src/lib/libutil/util.h @@ -1,4 +1,4 @@ -/* $OpenBSD: util.h,v 1.3 1996/12/03 01:05:36 downsj Exp $ */ +/* $OpenBSD: util.h,v 1.4 1996/12/23 07:43:42 downsj Exp $ */ /* $NetBSD: util.h,v 1.2 1996/05/16 07:00:22 thorpej Exp $ */ /*- @@ -72,7 +72,7 @@ pid_t forkpty __P((int *, char *, struct termios *, struct winsize *)); int getmaxpartitions __P((void)); int getrawpartition __P((void)); void login_fbtab __P((char *, uid_t, gid_t)); -char *readlabelfs __P((char *)); +char *readlabelfs __P((char *, int)); __END_DECLS #endif /* !_UTIL_H_ */