Skip to content

Commit 50d5968

Browse files
committed
simplify LFS
1 parent 36341a9 commit 50d5968

File tree

6 files changed

+3
-65
lines changed

6 files changed

+3
-65
lines changed

.clang_complete

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
-pipe
1313
-fPIC
1414
-g
15-
-D_GNU_SOURCE
16-
-DHAVE_STAT64=0
15+
-D_GNU_SOURCE
16+
-D_FILE_OFFSET_BITS=64
1717
-I/usr/include/gtk-3.0
1818
-I/usr/include/at-spi2-atk/2.0
1919
-I/usr/include/gtk-3.0

SConstruct

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -191,28 +191,6 @@ def check_fiemap(context):
191191
return rc
192192

193193

194-
def check_bigfiles(context):
195-
off_t_is_big_enough = True
196-
197-
if tests.CheckTypeSize(context, 'off_t', header='#include <sys/types.h>\n') < 8:
198-
off_t_is_big_enough = False
199-
200-
have_stat64 = True
201-
if tests.CheckFunc(
202-
context, 'stat64'
203-
):
204-
have_stat64 = False
205-
206-
rc = int(off_t_is_big_enough or have_stat64)
207-
conf.env['HAVE_BIG_OFF_T'] = int(off_t_is_big_enough)
208-
conf.env['HAVE_BIG_STAT'] = int(have_stat64)
209-
conf.env['HAVE_BIGFILES'] = rc
210-
211-
context.did_show_result = True
212-
context.Result(rc)
213-
return rc
214-
215-
216194
def check_blkid(context):
217195
rc = 1
218196

@@ -560,7 +538,6 @@ conf = Configure(env, custom_tests={
560538
'check_blkid': check_blkid,
561539
'check_posix_fadvise': check_posix_fadvise,
562540
'check_sys_block': check_sys_block,
563-
'check_bigfiles': check_bigfiles,
564541
'check_c11': check_c11,
565542
'check_gettext': check_gettext,
566543
'check_linux_limits': check_linux_limits,
@@ -648,7 +625,7 @@ else:
648625
conf.env.Append(CCFLAGS=c_standard)
649626

650627
conf.env.Append(CCFLAGS=[
651-
'-pipe', '-D_GNU_SOURCE'
628+
'-pipe', '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64'
652629
])
653630

654631
# Support cygwin:
@@ -693,7 +670,6 @@ conf.check_libelf()
693670
conf.check_fiemap()
694671
conf.check_xattr()
695672
conf.check_lxattr()
696-
conf.check_bigfiles()
697673
conf.check_sha512()
698674
conf.check_gettext()
699675
conf.check_linux_limits()
@@ -886,9 +862,6 @@ if 'config' in COMMAND_LINE_TARGETS:
886862
Build manpage from docs/rmlint.1.rst : {sphinx}
887863
Support for caching checksums in file's xattr : {xattr}
888864
Support for reading json caches (needs json-glib) : {json_glib}
889-
Checking for proper support of big files >= 4GB : {bigfiles}
890-
(needs either sizeof(off_t) >= 8 ...) : {bigofft}
891-
(... or presence of stat64) : {bigstat}
892865
893866
Optimize non-rotational disks : {nonrotational}
894867
(needs libblkid for resolving dev_t to path) : {blkid}
@@ -922,9 +895,6 @@ Type 'scons' to actually compile rmlint now. Good luck.
922895
blkid=yesno(env['HAVE_BLKID']),
923896
fiemap=yesno(env['HAVE_FIEMAP']),
924897
sha512=yesno(env['HAVE_SHA512']),
925-
bigfiles=yesno(env['HAVE_BIGFILES']),
926-
bigofft=yesno(env['HAVE_BIG_OFF_T']),
927-
bigstat=yesno(env['HAVE_BIG_STAT']),
928898
sphinx=COLORS['green'] + 'yes, using ' + COLORS['end'] + sphinx_bin if sphinx_bin else yesno(sphinx_bin),
929899
compiler=env['CC'],
930900
prefix=GetOption('prefix'),

lib/SConscript

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ def build_config_template(target, source, env):
2626
HAVE_XATTR=env['HAVE_XATTR'],
2727
HAVE_LXATTR=env['HAVE_LXATTR'],
2828
HAVE_SHA512=env['HAVE_SHA512'],
29-
HAVE_BIGFILES=env['HAVE_BIGFILES'],
30-
HAVE_STAT64=env['HAVE_BIG_STAT'],
3129
HAVE_POSIX_FADVISE=env['HAVE_POSIX_FADVISE'],
32-
HAVE_BIG_OFF_T=env['HAVE_BIG_OFF_T'],
3330
HAVE_BLKID=env['HAVE_BLKID'],
3431
HAVE_SYSBLOCK=env['HAVE_SYSBLOCK'],
3532
HAVE_LINUX_LIMITS=env['HAVE_LINUX_LIMITS'],

lib/cmdline.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ static void rm_cmd_show_version(void) {
7373
{.name = "nonstripped", .enabled = HAVE_LIBELF},
7474
{.name = "fiemap", .enabled = HAVE_FIEMAP},
7575
{.name = "sha512", .enabled = HAVE_SHA512},
76-
{.name = "bigfiles", .enabled = HAVE_BIGFILES},
7776
{.name = "intl", .enabled = HAVE_LIBINTL},
7877
{.name = "replay", .enabled = HAVE_JSON_GLIB},
7978
{.name = "xattr", .enabled = HAVE_XATTR},

lib/config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
#define HAVE_XATTR ({HAVE_XATTR})
1313
#define HAVE_LXATTR ({HAVE_LXATTR})
1414
#define HAVE_SHA512 ({HAVE_SHA512})
15-
#define HAVE_BIGFILES ({HAVE_BIGFILES})
16-
#define HAVE_STAT64 ({HAVE_STAT64})
17-
#define HAVE_BIG_OFF_T ({HAVE_BIG_OFF_T})
1815
#define HAVE_SYSBLOCK ({HAVE_SYSBLOCK})
1916
#define HAVE_LINUX_LIMITS ({HAVE_LINUX_LIMITS})
2017
#define HAVE_POSIX_FADVISE ({HAVE_POSIX_FADVISE})

lib/utilities.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,7 @@ typedef enum RmLinkType {
5353
RM_LINK_ERROR = 11,
5454
} RmLinkType;
5555

56-
57-
#if HAVE_STAT64 && !RM_IS_APPLE
58-
typedef struct stat64 RmStat;
59-
#else
6056
typedef struct stat RmStat;
61-
#endif
6257

6358
////////////////////////
6459
// MATHS SHORTCUTS //
@@ -88,19 +83,11 @@ typedef struct stat RmStat;
8883
////////////////////////////////////
8984

9085
WARN_UNUSED_RESULT static inline int rm_sys_stat(const char *path, RmStat *buf) {
91-
#if HAVE_STAT64 && !RM_IS_APPLE
92-
return stat64(path, buf);
93-
#else
9486
return stat(path, buf);
95-
#endif
9687
}
9788

9889
WARN_UNUSED_RESULT static inline int rm_sys_lstat(const char *path, RmStat *buf) {
99-
#if HAVE_STAT64 && !RM_IS_APPLE
100-
return lstat64(path, buf);
101-
#else
10290
return lstat(path, buf);
103-
#endif
10491
}
10592

10693
static inline gdouble rm_sys_stat_mtime_float(RmStat *stat) {
@@ -112,12 +99,6 @@ static inline gdouble rm_sys_stat_mtime_float(RmStat *stat) {
11299
}
113100

114101
static inline int rm_sys_open(const char *path, int mode) {
115-
#if HAVE_STAT64
116-
#ifdef O_LARGEFILE
117-
mode |= O_LARGEFILE;
118-
#endif
119-
#endif
120-
121102
return open(path, mode, (S_IRUSR | S_IWUSR));
122103
}
123104

@@ -135,12 +116,6 @@ static inline gint64 rm_sys_preadv(int fd, const struct iovec *iov, int iovcnt,
135116
return 0;
136117
}
137118
return readv(fd, iov, iovcnt);
138-
#elif RM_PLATFORM_32
139-
if(lseek64(fd, offset, SEEK_SET) == -1) {
140-
rm_log_perror("seek in emulated preadv failed");
141-
return 0;
142-
}
143-
return readv(fd, iov, iovcnt);
144119
#else
145120
return preadv(fd, iov, iovcnt, offset);
146121
#endif

0 commit comments

Comments
 (0)