Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/libbb/isdirectory.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/libbb/isdirectory.c
r821 r2725 4 4 * 5 5 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell 6 * Permission has been granted to redistribute this code under theGPL.6 * Permission has been granted to redistribute this code under GPL. 7 7 * 8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.8 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 9 9 */ 10 10 … … 13 13 14 14 /* 15 * Return TRUE if afileName is a directory.15 * Return TRUE if fileName is a directory. 16 16 * Nonexistent files return FALSE. 17 17 */ 18 int is_directory(const char *fileName, constint followLinks, struct stat *statBuf)18 int FAST_FUNC is_directory(const char *fileName, int followLinks, struct stat *statBuf) 19 19 { 20 20 int status; … … 22 22 23 23 if (statBuf == NULL) { 24 /* set fromauto stack buffer */25 24 /* use auto stack buffer */ 25 statBuf = &astatBuf; 26 26 } 27 27 … … 31 31 status = lstat(fileName, statBuf); 32 32 33 if (status < 0 || !(S_ISDIR(statBuf->st_mode))) { 34 status = FALSE; 35 } 36 else status = TRUE; 33 status = (status == 0 && S_ISDIR(statBuf->st_mode)); 37 34 38 35 return status;
Note:
See TracChangeset
for help on using the changeset viewer.