1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Remove an usused variable from alpm/util.c/_alpm_lckmk()

Probably a tweakable "lockdb-retry" option was planned which is not
implemented. (Now it should be implemented in front-end.)

So now this variable was unused and caused a small memleak.
(FREE(dir) was not reached in case of error.)

Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Nagy Gabor 2008-08-17 21:26:49 +02:00 committed by Dan McGee
parent 232b838a54
commit 729651a554

View File

@ -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);
}