-/* $OpenBSD: chmod.c,v 1.29 2014/03/16 18:38:30 guenther Exp $ */
+/* $OpenBSD: chmod.c,v 1.30 2014/05/21 06:23:01 guenther Exp $ */
/* $NetBSD: chmod.c,v 1.12 1995/03/21 09:02:09 cgd Exp $ */
/*
else
continue;
case FTS_DNR: /* Warn, chmod, continue. */
- warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
+ warnc(p->fts_errno, "%s", p->fts_path);
rval = 1;
break;
case FTS_DP: /* Already changed at FTS_D. */
break;
case FTS_ERR: /* Warn, continue. */
case FTS_NS:
- warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
+ warnc(p->fts_errno, "%s", p->fts_path);
rval = 1;
continue;
case FTS_SL: /* Ignore. */
-/* $OpenBSD: cp.c,v 1.35 2012/08/28 06:02:58 otto Exp $ */
+/* $OpenBSD: cp.c,v 1.36 2014/05/21 06:23:02 guenther Exp $ */
/* $NetBSD: cp.c,v 1.14 1995/09/07 06:14:51 jtc Exp $ */
/*
if (mkdir(to.p_path,
curr->fts_statp->st_mode | S_IRWXU) < 0)
err(1, "%s", to.p_path);
- } else if (!S_ISDIR(to_stat.st_mode)) {
- errno = ENOTDIR;
- err(1, "%s", to.p_path);
- }
+ } else if (!S_ISDIR(to_stat.st_mode))
+ errc(1, ENOTDIR, "%s", to.p_path);
break;
case S_IFBLK:
case S_IFCHR:
rval = 1;
break;
case S_IFSOCK:
- warnx("%s: %s", curr->fts_path, strerror(EOPNOTSUPP));
+ warnc(EOPNOTSUPP, "%s", curr->fts_path);
break;
default:
if (copy_file(curr, fts_dne(curr)))
-/* $OpenBSD: args.c,v 1.24 2014/03/27 15:32:13 tedu Exp $ */
+/* $OpenBSD: args.c,v 1.25 2014/05/21 06:23:02 guenther Exp $ */
/* $NetBSD: args.c,v 1.7 1996/03/01 01:18:58 jtc Exp $ */
/*-
}
return (num);
erange:
- errx(1, "%s: %s", oper, strerror(ERANGE));
+ errc(1, ERANGE, "%s", oper);
}
/*
}
return (num);
erange:
- errx(1, "%s: %s", oper, strerror(ERANGE));
+ errc(1, ERANGE, "%s", oper);
}
-/* $OpenBSD: mv.c,v 1.35 2009/10/27 23:59:22 deraadt Exp $ */
+/* $OpenBSD: mv.c,v 1.36 2014/05/21 06:23:02 guenther Exp $ */
/* $NetBSD: mv.c,v 1.9 1995/03/21 09:06:52 cgd Exp $ */
/*
(void)close(from_fd);
if (badchown) {
- errno = serrno;
if ((sbp->st_mode & (S_ISUID|S_ISGID))) {
- warn("%s: set owner/group; not setting setuid/setgid",
+ warnc(serrno,
+ "%s: set owner/group; not setting setuid/setgid",
to);
sbp->st_mode &= ~(S_ISUID|S_ISGID);
} else if (!fflg)
- warn("%s: set owner/group", to);
+ warnc(serrno, "%s: set owner/group", to);
}
if (fchmod(to_fd, sbp->st_mode))
warn("%s: set mode", to);
-/* $OpenBSD: rm.c,v 1.28 2013/04/23 18:41:08 deraadt Exp $ */
+/* $OpenBSD: rm.c,v 1.29 2014/05/21 06:23:02 guenther Exp $ */
/* $NetBSD: rm.c,v 1.19 1995/09/07 06:48:50 jtc Exp $ */
/*-
}
continue;
case FTS_ERR:
- errx(1, "%s: %s", p->fts_path, strerror(p->fts_errno));
+ errc(1, p->fts_errno, "%s", p->fts_path);
case FTS_NS:
/*
* FTS_NS: assume that if can't stat the file, it
-/* $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 $ */
/*
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);
-/* $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 $ */
/*
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))