diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2014-05-21 06:23:03 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2014-05-21 06:23:03 +0000 |
commit | 58d6b0c0f6c4bb2a9fe1e5ec494c8124c7083c27 (patch) | |
tree | 425d1eb0976b16a317345afdfa1e11db7a9c71cb /sbin | |
parent | 06c1f7e88086cc8bc06ccbe161ef507e32244f7a (diff) |
Use errc/warnc to simplify code.
ok jca@ krw@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/mount_nfs/mount_nfs.c | 5 | ||||
-rw-r--r-- | sbin/newfs_ext2fs/newfs_ext2fs.c | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c index 33c0c692373..74a10d6359d 100644 --- a/sbin/mount_nfs/mount_nfs.c +++ b/sbin/mount_nfs/mount_nfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount_nfs.c,v 1.50 2012/05/29 20:04:59 jasper Exp $ */ +/* $OpenBSD: mount_nfs.c,v 1.51 2014/05/21 06:23:01 guenther Exp $ */ /* $NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl Exp $ */ /* @@ -505,8 +505,7 @@ tryagain: if (nfhret.stat) { if (opflags & ISBGRND) exit(1); - errno = nfhret.stat; - warnx("can't access %s: %s", spec, strerror(nfhret.stat)); + warnc(nfhret.stat, "can't access %s", spec); return (0); } saddr.sin_port = htons(tport); diff --git a/sbin/newfs_ext2fs/newfs_ext2fs.c b/sbin/newfs_ext2fs/newfs_ext2fs.c index ba3e8e307f1..55e2eb5945e 100644 --- a/sbin/newfs_ext2fs/newfs_ext2fs.c +++ b/sbin/newfs_ext2fs/newfs_ext2fs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newfs_ext2fs.c,v 1.11 2014/04/22 00:23:35 guenther Exp $ */ +/* $OpenBSD: newfs_ext2fs.c,v 1.12 2014/05/21 06:23:01 guenther Exp $ */ /* $NetBSD: newfs_ext2fs.c,v 1.8 2009/03/02 10:38:13 tsutsui Exp $ */ /* @@ -511,7 +511,7 @@ getpartition(int fsi, const char *special, char *argv[], struct disklabel **dl) struct partition *pp; if (fstat(fsi, &st) < 0) - errx(EXIT_FAILURE, "%s: %s", special, strerror(errno)); + err(EXIT_FAILURE, "%s", special); if (S_ISBLK(st.st_mode)) errx(EXIT_FAILURE, "%s: block device", special); if (!S_ISCHR(st.st_mode)) |