Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
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 /lib/libalpm/add.c
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 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index c6830dce..d66ab934 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -547,9 +547,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
}
/* save the cwd so we can restore it later */
- do {
- cwdfd = open(".", O_RDONLY);
- } while(cwdfd == -1 && errno == EINTR);
+ OPEN(cwdfd, ".", O_RDONLY);
if(cwdfd < 0) {
_alpm_log(handle, ALPM_LOG_ERROR, _("could not get current working directory\n"));
}
@@ -606,7 +604,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
_alpm_log(handle, ALPM_LOG_ERROR,
_("could not restore working directory (%s)\n"), strerror(errno));
}
- close(cwdfd);
+ CLOSE(cwdfd);
}
if(errors) {