Skip to content

Commit 61e2a2a

Browse files
committed
Include fcntl.h where needed
I was toying around with a home-made version of include-what-you-use, which showed that we're missing the include in a number of places. At the moment it is indirectly resolved via libkmod.h, which pulls said header for O_TRUNC and O_NONBLOCK. It's unlikely that we'll drop the include from the public header, although that doesn't mean that aiming for self-contained sources is a bad idea. For context: I am looking to remove the libkmod static link to init-module.so and part of that meant building libkmod-elf.c without the rest of kmod. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
1 parent ca310a3 commit 61e2a2a

7 files changed

Lines changed: 7 additions & 0 deletions

File tree

libkmod/libkmod-config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <ctype.h>
88
#include <dirent.h>
99
#include <errno.h>
10+
#include <fcntl.h>
1011
#include <stdarg.h>
1112
#include <stddef.h>
1213
#include <stdio.h>

libkmod/libkmod-file-zlib.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define DLSYM_LOCALLY_ENABLED ENABLE_ZLIB_DLOPEN
77

88
#include <errno.h>
9+
#include <fcntl.h>
910
#include <stdio.h>
1011
#include <stdlib.h>
1112
#include <string.h>

libkmod/libkmod-file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <errno.h>
7+
#include <fcntl.h>
78
#include <limits.h>
89
#include <stdbool.h>
910
#include <stdio.h>

libkmod/libkmod-index.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <assert.h>
99
#include <endian.h>
1010
#include <errno.h>
11+
#include <fcntl.h>
1112
#include <fnmatch.h>
1213
#include <inttypes.h>
1314
#include <limits.h>

libkmod/libkmod-module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <ctype.h>
88
#include <dirent.h>
99
#include <errno.h>
10+
#include <fcntl.h>
1011
#include <fnmatch.h>
1112
#include <inttypes.h>
1213
#include <limits.h>

libkmod/libkmod.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <assert.h>
77
#include <ctype.h>
88
#include <errno.h>
9+
#include <fcntl.h>
910
#include <fnmatch.h>
1011
#include <limits.h>
1112
#include <stdarg.h>

tools/depmod.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <dirent.h>
1010
#include <endian.h>
1111
#include <errno.h>
12+
#include <fcntl.h>
1213
#include <getopt.h>
1314
#include <limits.h>
1415
#include <regex.h>

0 commit comments

Comments
 (0)