Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/libbb/isdirectory.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/libbb/isdirectory.c
r2725 r3232 16 16 * Nonexistent files return FALSE. 17 17 */ 18 int FAST_FUNC is_directory(const char *fileName, int followLinks , struct stat *statBuf)18 int FAST_FUNC is_directory(const char *fileName, int followLinks) 19 19 { 20 20 int status; 21 struct stat astatBuf; 22 23 if (statBuf == NULL) { 24 /* use auto stack buffer */ 25 statBuf = &astatBuf; 26 } 21 struct stat statBuf; 27 22 28 23 if (followLinks) 29 status = stat(fileName, statBuf);24 status = stat(fileName, &statBuf); 30 25 else 31 status = lstat(fileName, statBuf);26 status = lstat(fileName, &statBuf); 32 27 33 status = (status == 0 && S_ISDIR(statBuf ->st_mode));28 status = (status == 0 && S_ISDIR(statBuf.st_mode)); 34 29 35 30 return status;
Note:
See TracChangeset
for help on using the changeset viewer.