diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-11-19 16:14:09 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-11-19 16:14:09 +0000 |
commit | 5263b85aedabacb62d8eda3280a9048f429ad230 (patch) | |
tree | 8db279b117c4662be31418bb7f93a7a88c971a92 /sbin/fdisk | |
parent | 9b1eeb280d840d864dcfa37749ad84b28593145d (diff) |
Reduce overburden of unnecessary #include's. Note that param.h is
included only for DEV_BSIZE. Use INT64_MAX instead of LLONG_MAX
so stdint.h is enough. General tidying up of #include sections.
ok GCC
Diffstat (limited to 'sbin/fdisk')
-rw-r--r-- | sbin/fdisk/cmd.c | 12 | ||||
-rw-r--r-- | sbin/fdisk/disk.c | 7 | ||||
-rw-r--r-- | sbin/fdisk/gpt.c | 10 | ||||
-rw-r--r-- | sbin/fdisk/mbr.c | 11 | ||||
-rw-r--r-- | sbin/fdisk/misc.c | 7 | ||||
-rw-r--r-- | sbin/fdisk/part.c | 3 | ||||
-rw-r--r-- | sbin/fdisk/user.c | 3 |
7 files changed, 24 insertions, 29 deletions
diff --git a/sbin/fdisk/cmd.c b/sbin/fdisk/cmd.c index 19179f7ba17..bb573558c71 100644 --- a/sbin/fdisk/cmd.c +++ b/sbin/fdisk/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.86 2015/11/18 17:09:26 krw Exp $ */ +/* $OpenBSD: cmd.c,v 1.87 2015/11/19 16:14:08 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -16,17 +16,15 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> #include <sys/types.h> -#include <sys/fcntl.h> #include <sys/disklabel.h> + #include <err.h> -#include <errno.h> +#include <signal.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <signal.h> -#include <unistd.h> #include <uuid.h> #include "disk.h" @@ -512,7 +510,7 @@ Xflag(char *args, struct mbr *mbr) if (flag != NULL) { /* Set flag to value provided. */ if (letoh64(gh.gh_sig) == GPTSIGNATURE) - val = strtonum(flag, 0, LLONG_MAX, &errstr); + val = strtonum(flag, 0, INT64_MAX, &errstr); else val = strtonum(flag, 0, 0xff, &errstr); if (errstr) { diff --git a/sbin/fdisk/disk.c b/sbin/fdisk/disk.c index 2a079fa80fd..023af31a8ce 100644 --- a/sbin/fdisk/disk.c +++ b/sbin/fdisk/disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disk.c,v 1.51 2015/11/14 21:17:08 krw Exp $ */ +/* $OpenBSD: disk.c,v 1.52 2015/11/19 16:14:08 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -20,15 +20,16 @@ #include <sys/fcntl.h> #include <sys/ioctl.h> #include <sys/dkio.h> -#include <sys/stdint.h> #include <sys/stat.h> #include <sys/disklabel.h> + #include <err.h> #include <errno.h> -#include <util.h> #include <stdio.h> +#include <stdint.h> #include <stdlib.h> #include <unistd.h> +#include <util.h> #include "disk.h" #include "misc.h" diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c index 2b8fdda5cb5..c1eae5145d6 100644 --- a/sbin/fdisk/gpt.c +++ b/sbin/fdisk/gpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.c,v 1.6 2015/11/15 01:22:39 krw Exp $ */ +/* $OpenBSD: gpt.c,v 1.7 2015/11/19 16:14:08 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller <mmu@grummel.net> * Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org> @@ -16,19 +16,17 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/types.h> -#include <sys/param.h> +#include <sys/param.h> /* DEV_BSIZE */ #include <sys/disklabel.h> #include <sys/dkio.h> -#include <sys/fcntl.h> #include <sys/ioctl.h> -#include <stdint.h> + +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <uuid.h> -#include <errno.h> #include "disk.h" #include "misc.h" diff --git a/sbin/fdisk/mbr.c b/sbin/fdisk/mbr.c index ae7f877fe98..7591d8919fc 100644 --- a/sbin/fdisk/mbr.c +++ b/sbin/fdisk/mbr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mbr.c,v 1.62 2015/11/18 17:09:26 krw Exp $ */ +/* $OpenBSD: mbr.c,v 1.63 2015/11/19 16:14:08 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -17,18 +17,13 @@ */ #include <sys/param.h> /* DEV_BSIZE */ -#include <sys/fcntl.h> #include <sys/ioctl.h> -#include <sys/stat.h> #include <sys/disklabel.h> #include <sys/dkio.h> -#include <err.h> -#include <errno.h> -#include <util.h> + +#include <stdint.h> #include <stdio.h> -#include <unistd.h> #include <stdlib.h> -#include <stdint.h> #include <string.h> #include "disk.h" diff --git a/sbin/fdisk/misc.c b/sbin/fdisk/misc.c index 8831929ad08..754128e47c6 100644 --- a/sbin/fdisk/misc.c +++ b/sbin/fdisk/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.57 2015/11/12 17:54:50 tim Exp $ */ +/* $OpenBSD: misc.c,v 1.58 2015/11/19 16:14:08 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -18,12 +18,13 @@ #include <sys/types.h> #include <sys/disklabel.h> + #include <ctype.h> +#include <err.h> +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <err.h> -#include <errno.h> #include <uuid.h> #include "disk.h" diff --git a/sbin/fdisk/part.c b/sbin/fdisk/part.c index 04ce07a7d18..b56ddb0f0f4 100644 --- a/sbin/fdisk/part.c +++ b/sbin/fdisk/part.c @@ -1,4 +1,4 @@ -/* $OpenBSD: part.c,v 1.73 2015/10/26 15:08:26 krw Exp $ */ +/* $OpenBSD: part.c,v 1.74 2015/11/19 16:14:08 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -18,6 +18,7 @@ #include <sys/types.h> #include <sys/disklabel.h> + #include <err.h> #include <stdio.h> #include <stdlib.h> diff --git a/sbin/fdisk/user.c b/sbin/fdisk/user.c index ab40e1a238e..e2e5b7e193e 100644 --- a/sbin/fdisk/user.c +++ b/sbin/fdisk/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.47 2015/11/18 02:12:51 krw Exp $ */ +/* $OpenBSD: user.c,v 1.48 2015/11/19 16:14:08 krw Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -19,6 +19,7 @@ #include <sys/types.h> #include <sys/fcntl.h> #include <sys/disklabel.h> + #include <err.h> #include <stdio.h> #include <string.h> |