X Tutup
Skip to content

Commit fde3202

Browse files
committed
Move LONG_LINE_MAX definition to fileio.h
All users of the macro (except for one, in serialize.c), use the macro in connection with read_line(), so they must include fileio.h. Let's not play libc games and require multiple header file to be included for the most common use of a function. The removal of def.h includes is not exact. I mostly went over the commits that switch over to use read_line() and add def.h at the same time and reverted the addition of def.h in those files.
1 parent 0221d68 commit fde3202

File tree

27 files changed

+3
-27
lines changed

27 files changed

+3
-27
lines changed

src/backlight/backlight.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "sd-device.h"
44

55
#include "alloc-util.h"
6-
#include "def.h"
76
#include "device-util.h"
87
#include "escape.h"
98
#include "fileio.h"

src/basic/clock-util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "alloc-util.h"
1414
#include "clock-util.h"
15-
#include "def.h"
1615
#include "fd-util.h"
1716
#include "fileio.h"
1817
#include "macro.h"

src/basic/def.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,4 @@
7474
"/usr/lib/" n \
7575
_CONF_PATHS_SPLIT_USR(n))
7676

77-
#define LONG_LINE_MAX (1U*1024U*1024U)
78-
7977
#define HIGH_RLIMIT_MEMLOCK (1024ULL*1024ULL*64ULL)

src/basic/exec-util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include "alloc-util.h"
1111
#include "conf-files.h"
12-
#include "def.h"
1312
#include "env-util.h"
1413
#include "exec-util.h"
1514
#include "fd-util.h"

src/basic/fileio.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#include "alloc-util.h"
1717
#include "ctype.h"
18-
#include "def.h"
1918
#include "env-util.h"
2019
#include "escape.h"
2120
#include "fd-util.h"

src/basic/fileio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "macro.h"
1111
#include "time-util.h"
1212

13+
#define LONG_LINE_MAX (1U*1024U*1024U)
14+
1315
typedef enum {
1416
WRITE_STRING_FILE_CREATE = 1 << 0,
1517
WRITE_STRING_FILE_ATOMIC = 1 << 1,

src/basic/hostname-util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <unistd.h>
99

1010
#include "alloc-util.h"
11-
#include "def.h"
1211
#include "fd-util.h"
1312
#include "fileio.h"
1413
#include "hostname-util.h"

src/basic/mount-util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <libmount.h>
1414

1515
#include "alloc-util.h"
16-
#include "def.h"
1716
#include "escape.h"
1817
#include "extract-word.h"
1918
#include "fd-util.h"

src/basic/process-util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include "alloc-util.h"
2727
#include "architecture.h"
28-
#include "def.h"
2928
#include "escape.h"
3029
#include "fd-util.h"
3130
#include "fileio.h"

src/basic/time-util.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <unistd.h>
1515

1616
#include "alloc-util.h"
17-
#include "def.h"
1817
#include "fd-util.h"
1918
#include "fileio.h"
2019
#include "fs-util.h"

0 commit comments

Comments
 (0)
X Tutup