Lines 15-27
Link Here
|
15 |
bool |
15 |
bool |
16 |
rc_file_exists (const char *pathname) |
16 |
rc_file_exists (const char *pathname) |
17 |
{ |
17 |
{ |
18 |
struct stat buf; |
18 |
struct stat64 buf; |
19 |
int retval; |
19 |
int retval; |
20 |
|
20 |
|
21 |
if (!check_str (pathname)) |
21 |
if (!check_str (pathname)) |
22 |
return false; |
22 |
return false; |
23 |
|
23 |
|
24 |
retval = lstat (pathname, &buf); |
24 |
retval = lstat64 (pathname, &buf); |
25 |
if (-1 != retval) |
25 |
if (-1 != retval) |
26 |
retval = true; |
26 |
retval = true; |
27 |
else |
27 |
else |
Lines 33-45
Link Here
|
33 |
bool |
33 |
bool |
34 |
rc_is_file (const char *pathname, bool follow_link) |
34 |
rc_is_file (const char *pathname, bool follow_link) |
35 |
{ |
35 |
{ |
36 |
struct stat buf; |
36 |
struct stat64 buf; |
37 |
int retval; |
37 |
int retval; |
38 |
|
38 |
|
39 |
if (!check_str (pathname)) |
39 |
if (!check_str (pathname)) |
40 |
return false; |
40 |
return false; |
41 |
|
41 |
|
42 |
retval = follow_link ? stat (pathname, &buf) : lstat (pathname, &buf); |
42 |
retval = follow_link ? stat64 (pathname, &buf) : lstat64 (pathname, &buf); |
43 |
if ((-1 != retval) && (S_ISREG (buf.st_mode))) |
43 |
if ((-1 != retval) && (S_ISREG (buf.st_mode))) |
44 |
retval = true; |
44 |
retval = true; |
45 |
else |
45 |
else |
Lines 51-63
Link Here
|
51 |
bool |
51 |
bool |
52 |
rc_is_dir (const char *pathname, bool follow_link) |
52 |
rc_is_dir (const char *pathname, bool follow_link) |
53 |
{ |
53 |
{ |
54 |
struct stat buf; |
54 |
struct stat64 buf; |
55 |
int retval; |
55 |
int retval; |
56 |
|
56 |
|
57 |
if (!check_str (pathname)) |
57 |
if (!check_str (pathname)) |
58 |
return false; |
58 |
return false; |
59 |
|
59 |
|
60 |
retval = follow_link ? stat (pathname, &buf) : lstat (pathname, &buf); |
60 |
retval = follow_link ? stat64 (pathname, &buf) : lstat64 (pathname, &buf); |
61 |
if ((-1 != retval) && (S_ISDIR (buf.st_mode))) |
61 |
if ((-1 != retval) && (S_ISDIR (buf.st_mode))) |
62 |
retval = true; |
62 |
retval = true; |
63 |
else |
63 |
else |
Lines 69-81
Link Here
|
69 |
off_t |
69 |
off_t |
70 |
rc_get_size (const char *pathname, bool follow_link) |
70 |
rc_get_size (const char *pathname, bool follow_link) |
71 |
{ |
71 |
{ |
72 |
struct stat buf; |
72 |
struct stat64 buf; |
73 |
int retval; |
73 |
int retval; |
74 |
|
74 |
|
75 |
if (!check_str (pathname)) |
75 |
if (!check_str (pathname)) |
76 |
return 0; |
76 |
return 0; |
77 |
|
77 |
|
78 |
retval = follow_link ? stat (pathname, &buf) : lstat (pathname, &buf); |
78 |
retval = follow_link ? stat64 (pathname, &buf) : lstat64 (pathname, &buf); |
79 |
if (-1 != retval) |
79 |
if (-1 != retval) |
80 |
retval = buf.st_size; |
80 |
retval = buf.st_size; |
81 |
else |
81 |
else |
Lines 196-202
Link Here
|
196 |
int |
196 |
int |
197 |
rc_file_map (const char *filename, char **buf, size_t * bufsize) |
197 |
rc_file_map (const char *filename, char **buf, size_t * bufsize) |
198 |
{ |
198 |
{ |
199 |
struct stat stats; |
199 |
struct stat64 stats; |
200 |
int fd; |
200 |
int fd; |
201 |
|
201 |
|
202 |
fd = open (filename, O_RDONLY); |
202 |
fd = open (filename, O_RDONLY); |
Lines 207-213
Link Here
|
207 |
return -1; |
207 |
return -1; |
208 |
} |
208 |
} |
209 |
|
209 |
|
210 |
if (fstat (fd, &stats) < 0) |
210 |
if (fstat64 (fd, &stats) < 0) |
211 |
{ |
211 |
{ |
212 |
rc_errno_set (errno); |
212 |
rc_errno_set (errno); |
213 |
DBG_MSG ("Failed to stat file!\n"); |
213 |
DBG_MSG ("Failed to stat file!\n"); |