Skip to content

Commit f414793

Browse files
author
guenther
committed
Use <fcntl.h> instead of <sys/file.h> for open() and friends.
Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
1 parent e4ca1de commit f414793

File tree

50 files changed

+87
-181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+87
-181
lines changed

distrib/common/elfrd_size.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
/* $OpenBSD: elfrd_size.c,v 1.8 2017/12/03 19:32:19 tb Exp $ */
1+
/* $OpenBSD: elfrd_size.c,v 1.9 2018/04/26 12:42:50 guenther Exp $ */
22

33
#include <sys/types.h>
4-
#include <sys/file.h>
54
#include <sys/mman.h>
65
#include <sys/stat.h>
76

distrib/common/elfrdsetroot.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: elfrdsetroot.c,v 1.25 2017/12/03 19:32:19 tb Exp $ */
1+
/* $OpenBSD: elfrdsetroot.c,v 1.26 2018/04/26 12:42:50 guenther Exp $ */
22
/* $NetBSD: rdsetroot.c,v 1.2 1995/10/13 16:38:39 gwr Exp $ */
33

44
/*
@@ -35,15 +35,14 @@
3535
*/
3636

3737
#include <sys/types.h>
38-
#include <sys/file.h>
3938
#include <sys/mman.h>
4039
#include <sys/stat.h>
4140

4241
#include <elf.h>
42+
#include <fcntl.h>
4343
#include <stdio.h>
4444
#include <stdlib.h>
4545
#include <unistd.h>
46-
#include <nlist.h>
4746

4847
#include "elfrdsetroot.h"
4948

distrib/special/more/more.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: more.c,v 1.38 2015/11/15 07:12:50 deraadt Exp $ */
1+
/* $OpenBSD: more.c,v 1.39 2018/04/26 12:42:50 guenther Exp $ */
22

33
/*
44
* Copyright (c) 2003 Todd C. Miller <[email protected]>
@@ -65,17 +65,14 @@
6565
#include <sys/types.h>
6666
#include <sys/exec.h>
6767
#include <sys/ioctl.h>
68-
#include <sys/file.h>
6968
#include <sys/stat.h>
70-
#include <sys/wait.h>
7169

7270
#include <ctype.h>
7371
#include <curses.h>
7472
#include <errno.h>
7573
#include <locale.h>
7674
#include <regex.h>
7775
#include <signal.h>
78-
#include <stdarg.h>
7976
#include <stdio.h>
8077
#include <stdlib.h>
8178
#include <string.h>

libexec/ld.so/ldconfig/ldconfig.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: ldconfig.c,v 1.36 2016/07/04 20:56:50 kettenis Exp $ */
1+
/* $OpenBSD: ldconfig.c,v 1.37 2018/04/26 12:42:50 guenther Exp $ */
22

33
/*
44
* Copyright (c) 1993,1995 Paul Kranenburg
@@ -32,11 +32,8 @@
3232

3333
#include <sys/types.h>
3434
#include <sys/stat.h>
35-
#include <sys/file.h>
36-
#include <sys/time.h>
3735
#include <sys/mman.h>
38-
#include <sys/resource.h>
39-
#include <ctype.h>
36+
4037
#include <dirent.h>
4138
#include <err.h>
4239
#include <errno.h>

libexec/ld.so/ldconfig/shlib.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: shlib.c,v 1.12 2015/12/22 08:15:05 mmcc Exp $ */
1+
/* $OpenBSD: shlib.c,v 1.13 2018/04/26 12:42:50 guenther Exp $ */
22
/* $NetBSD: shlib.c,v 1.13 1998/04/04 01:00:29 fvdl Exp $ */
33

44
/*
@@ -32,16 +32,8 @@
3232
*
3333
*/
3434

35-
#include <sys/types.h>
36-
#include <sys/stat.h>
37-
#include <sys/file.h>
38-
#include <sys/time.h>
39-
#include <ranlib.h>
4035
#include <ctype.h>
41-
#include <dirent.h>
4236
#include <err.h>
43-
#include <fcntl.h>
44-
#include <stdio.h>
4537
#include <stdlib.h>
4638
#include <string.h>
4739

libexec/login_chpass/login_chpass.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: login_chpass.c,v 1.20 2015/11/26 19:01:47 deraadt Exp $ */
1+
/* $OpenBSD: login_chpass.c,v 1.21 2018/04/26 12:42:51 guenther Exp $ */
22

33
/*-
44
* Copyright (c) 1995,1996 Berkeley Software Design, Inc. All rights reserved.
@@ -33,23 +33,14 @@
3333
*
3434
* BSDI $From: login_chpass.c,v 1.3 1996/08/21 21:01:48 prb Exp $
3535
*/
36-
#include <sys/stat.h>
37-
#include <sys/time.h>
36+
3837
#include <sys/resource.h>
39-
#include <sys/file.h>
40-
#include <sys/uio.h>
41-
#include <sys/wait.h>
4238

4339
#include <err.h>
44-
#include <errno.h>
45-
#include <pwd.h>
46-
#include <signal.h>
47-
#include <stdio.h>
4840
#include <stdlib.h>
4941
#include <string.h>
5042
#include <syslog.h>
5143
#include <unistd.h>
52-
#include <login_cap.h>
5344

5445
#define _PATH_LOGIN_LCHPASS "/usr/libexec/auth/login_lchpass"
5546

libexec/login_lchpass/login_lchpass.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: login_lchpass.c,v 1.20 2016/09/03 10:48:15 gsoares Exp $ */
1+
/* $OpenBSD: login_lchpass.c,v 1.21 2018/04/26 12:42:51 guenther Exp $ */
22

33
/*-
44
* Copyright (c) 1995,1996 Berkeley Software Design, Inc. All rights reserved.
@@ -33,23 +33,16 @@
3333
*
3434
* BSDI $From: login_lchpass.c,v 1.4 1997/08/08 18:58:23 prb Exp $
3535
*/
36-
#include <sys/stat.h>
37-
#include <sys/time.h>
36+
3837
#include <sys/resource.h>
39-
#include <sys/file.h>
4038
#include <sys/uio.h>
41-
#include <sys/wait.h>
4239

43-
#include <err.h>
44-
#include <errno.h>
4540
#include <pwd.h>
46-
#include <signal.h>
4741
#include <stdio.h>
4842
#include <stdlib.h>
4943
#include <string.h>
5044
#include <syslog.h>
5145
#include <unistd.h>
52-
#include <stdarg.h>
5346
#include <login_cap.h>
5447
#include <readpassphrase.h>
5548

libexec/login_reject/login_reject.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: login_reject.c,v 1.16 2016/09/03 10:51:26 gsoares Exp $ */
1+
/* $OpenBSD: login_reject.c,v 1.17 2018/04/26 12:42:51 guenther Exp $ */
22

33
/*-
44
* Copyright (c) 1995 Berkeley Software Design, Inc. All rights reserved.
@@ -33,19 +33,11 @@
3333
*
3434
* BSDI $From: login_reject.c,v 1.5 1996/08/22 20:43:11 prb Exp $
3535
*/
36-
#include <sys/stat.h>
37-
#include <sys/time.h>
36+
3837
#include <sys/resource.h>
39-
#include <sys/file.h>
40-
#include <sys/wait.h>
4138

42-
#include <err.h>
43-
#include <errno.h>
4439
#include <login_cap.h>
45-
#include <pwd.h>
4640
#include <readpassphrase.h>
47-
#include <signal.h>
48-
#include <stdarg.h>
4941
#include <stdio.h>
5042
#include <stdlib.h>
5143
#include <string.h>

libexec/rpc.rusersd/rusersd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: rusersd.c,v 1.19 2016/09/04 15:03:13 jca Exp $ */
1+
/* $OpenBSD: rusersd.c,v 1.20 2018/04/26 12:42:51 guenther Exp $ */
22

33
/*-
44
* Copyright (c) 1993 John Brezak
@@ -30,7 +30,8 @@
3030

3131
#include <sys/types.h>
3232
#include <sys/socket.h>
33-
#include <sys/file.h>
33+
34+
#include <fcntl.h>
3435
#include <stdio.h>
3536
#include <signal.h>
3637
#include <unistd.h>

usr.bin/cdio/cdio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: cdio.c,v 1.74 2015/01/16 06:40:06 deraadt Exp $ */
1+
/* $OpenBSD: cdio.c,v 1.75 2018/04/26 12:42:51 guenther Exp $ */
22

33
/* Copyright (c) 1995 Serge V. Vakulenko
44
* All rights reserved.
@@ -53,7 +53,6 @@
5353
*/
5454

5555
#include <sys/param.h> /* isset */
56-
#include <sys/file.h>
5756
#include <sys/cdio.h>
5857
#include <sys/ioctl.h>
5958
#include <sys/queue.h>
@@ -63,6 +62,7 @@
6362
#include <ctype.h>
6463
#include <err.h>
6564
#include <errno.h>
65+
#include <fcntl.h>
6666
#include <stdio.h>
6767
#include <stdlib.h>
6868
#include <string.h>

0 commit comments

Comments
 (0)