summaryrefslogtreecommitdiff
path: root/bin/rm
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-01-16 06:40:24 +0000
commit315054f4737a39489e0a14f3a92bff61f1592832 (patch)
tree62bf010653374ce09b6beb4dfa0414a91457233b /bin/rm
parent79e3d817585ca08a91e30ad14abe43e2ab70295f (diff)
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'bin/rm')
-rw-r--r--bin/rm/rm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index ed43f02e5b8..833d3039b97 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rm.c,v 1.29 2014/05/21 06:23:02 guenther Exp $ */
+/* $OpenBSD: rm.c,v 1.30 2015/01/16 06:39:32 deraadt Exp $ */
/* $NetBSD: rm.c,v 1.19 1995/09/07 06:48:50 jtc Exp $ */
/*-
@@ -32,7 +32,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include <sys/mount.h>
#include <locale.h>
@@ -44,9 +43,12 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include <pwd.h>
#include <grp.h>
+#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
+
extern char *__progname;
int dflag, eval, fflag, iflag, Pflag, stdin_ok;
@@ -304,7 +306,7 @@ rm_overwrite(char *file, struct stat *sbp)
}
if (fstatfs(fd, &fsb) == -1)
goto err;
- bsize = MAX(fsb.f_iosize, 1024U);
+ bsize = MAXIMUM(fsb.f_iosize, 1024U);
if ((buf = malloc(bsize)) == NULL)
err(1, "%s: malloc", file);