summaryrefslogtreecommitdiffhomepage
path: root/utility.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-10-17 05:43:39 +0000
committerEric Andersen <andersen@codepoet.org>1999-10-17 05:43:39 +0000
commit9b5871888989b16f94cbba5dd304ac444def3afd (patch)
tree17187e3f6988830c0e329378e552995d083080ed /utility.c
parentcb6e25655f894c90e4befc4bee0e66794dd6858f (diff)
Some fixes and such
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/utility.c b/utility.c
index cf90f37d1..4bb479f0c 100644
--- a/utility.c
+++ b/utility.c
@@ -46,8 +46,9 @@ int isDirectory(const char *name)
if (stat(name, &statBuf) < 0)
return FALSE;
-
- return S_ISDIR(statBuf.st_mode);
+ if (S_ISDIR(statBuf.st_mode))
+ return TRUE;
+ return(FALSE);
}
@@ -467,8 +468,8 @@ int fullRead(int fd, char *buf, int len)
*/
int
recursiveAction(const char *fileName, int recurse, int followLinks,
- int (*fileAction) (const char *fileName),
- int (*dirAction) (const char *fileName))
+ int (*fileAction) (const char *fileName, struct stat* statbuf),
+ int (*dirAction) (const char *fileName, struct stat* statbuf))
{
int status;
struct stat statbuf;
@@ -487,7 +488,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks,
if (recurse == FALSE) {
if (S_ISDIR(statbuf.st_mode)) {
if (dirAction != NULL)
- return (dirAction(fileName));
+ return (dirAction(fileName, &statbuf));
else
return (TRUE);
}
@@ -501,7 +502,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks,
return (FALSE);
}
if (dirAction != NULL) {
- status = dirAction(fileName);
+ status = dirAction(fileName, &statbuf);
if (status == FALSE) {
perror(fileName);
return (FALSE);
@@ -531,7 +532,7 @@ recursiveAction(const char *fileName, int recurse, int followLinks,
if (fileAction == NULL)
return (TRUE);
else
- return (fileAction(fileName));
+ return (fileAction(fileName, &statbuf));
}
return (TRUE);
}