index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2008-06-15 19:15:36 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-06-15 22:52:27 -0500 |
commit | 29bf6814f74096e5d8ea22058e638eb362717b8a (patch) | |
tree | 1b608ba8071c1c7e52808a4b178ba8225ef6d2b1 /src/pacman/util.c | |
parent | 7ff5a917fd0a91cd03ba61419a57053e4ae17e92 (diff) |
-rw-r--r-- | src/pacman/util.c | 6 |
diff --git a/src/pacman/util.c b/src/pacman/util.c index e702886b..d7ac9e38 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -22,7 +22,6 @@ #include <sys/types.h> #include <sys/ioctl.h> #include <sys/time.h> -#include <sys/stat.h> #include <stdio.h> #include <stdlib.h> @@ -125,7 +124,7 @@ int makepath(const char *path) * orig - a copy of path so we can safely butcher it with strsep * str - the current position in the path string (after the delimiter) * ptr - the original position of str after calling strsep - * incr - incrementally generated path for use in stat/mkdir call + * incr - incrementally generated path for use in access/mkdir call */ char *orig, *str, *ptr, *incr; mode_t oldmask = umask(0000); @@ -136,12 +135,11 @@ int makepath(const char *path) str = orig; while((ptr = strsep(&str, "/"))) { if(strlen(ptr)) { - struct stat buf; /* we have another path component- append the newest component to * existing string and create one more level of dir structure */ strcat(incr, "/"); strcat(incr, ptr); - if(stat(incr, &buf)) { + if(access(incr, F_OK)) { if(mkdir(incr, 0755)) { ret = 1; break; |