index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Nagy Gabor <ngaba@bibl.u-szeged.hu> | 2008-08-17 21:26:49 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-08-19 18:43:46 -0500 |
commit | 729651a55473f6e64c4dc95888efbe2e4c76efa0 (patch) | |
tree | cf0e256b09ceee95a999154092d0e8416b8cea7d /lib/libalpm | |
parent | 232b838a54e689800267e1b98ace207bd442b8cd (diff) |
-rw-r--r-- | lib/libalpm/util.c | 12 |
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 2847db7b..b26c9702 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -241,7 +241,7 @@ char *_alpm_strreplace(const char *str, const char *needle, const char *replace) /* Create a lock file */ int _alpm_lckmk() { - int fd, count = 0; + int fd; char *dir, *ptr; const char *file = alpm_option_get_lockfile(); @@ -252,17 +252,9 @@ int _alpm_lckmk() *ptr = '\0'; } _alpm_makepath(dir); - - while((fd = open(file, O_WRONLY | O_CREAT | O_EXCL, 0000)) == -1 && errno == EACCES) { - if(++count < 1) { - sleep(1); - } else { - return(-1); - } - } - FREE(dir); + fd = open(file, O_WRONLY | O_CREAT | O_EXCL, 0000); return(fd > 0 ? fd : -1); } |