summaryrefslogtreecommitdiff
path: root/src/pacman
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-27 15:47:18 -0500
committerDan McGee <dan@archlinux.org>2011-11-01 10:27:31 -0500
commitba7a056d586f78954ac874a3bebc6325f7e6eeb1 (patch)
tree03172fa34a61ab78d24c0b46747aaff9ca4c4875 /src/pacman
parenta4ce3edf95f148bc6eac16b6edd9bc281c7745af (diff)
Add OPEN() and CLOSE() util macros
These wrap the normal open() and close() low-level I/O calls and ensure EINTR is handled correctly. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman')
-rw-r--r--src/pacman/conf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 2d3009ec..69562067 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -203,11 +203,14 @@ static int download_with_xfercommand(const char *url, const char *localpath,
cleanup:
/* restore the old cwd if we have it */
if(cwdfd >= 0) {
+ int ret;
if(fchdir(cwdfd) != 0) {
pm_printf(ALPM_LOG_ERROR, _("could not restore working directory (%s)\n"),
strerror(errno));
}
- close(cwdfd);
+ do {
+ ret = close(cwdfd);
+ } while(ret == -1 && errno == EINTR);
}
if(ret == -1) {