index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Jonathan Conder <jonno.conder@gmail.com> | 2011-02-05 13:39:37 +1300 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-02-27 13:32:41 -0600 |
commit | acd9269478dbc40f1dac64d8f6ddfbb5f562ad09 (patch) | |
tree | da62cb17e4cc96ebb4d313c9f8d514b8e9d67e49 /lib/libalpm/trans.c | |
parent | e8f799ba83904db2a347e7d37fe217216a0faf90 (diff) |
-rw-r--r-- | lib/libalpm/trans.c | 13 |
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 9d582df3..9f617967 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -73,8 +73,8 @@ int SYMEXPORT alpm_trans_init(pmtransflag_t flags, /* lock db */ if(!(flags & PM_TRANS_FLAG_NOLOCK)) { - handle->lckfd = _alpm_lckmk(); - if(handle->lckfd == -1) { + handle->lckstream = _alpm_lckmk(); + if(handle->lckstream == NULL) { RET_ERR(PM_ERR_HANDLE_LOCK, -1); } } @@ -260,12 +260,9 @@ int SYMEXPORT alpm_trans_release() /* unlock db */ if(!nolock_flag) { - if(handle->lckfd != -1) { - int fd; - do { - fd = close(handle->lckfd); - } while(fd == -1 && errno == EINTR); - handle->lckfd = -1; + if(handle->lckstream != NULL) { + fclose(handle->lckstream); + handle->lckstream = NULL; } if(_alpm_lckrm()) { _alpm_log(PM_LOG_WARNING, _("could not remove lock file %s\n"), |