diff options
author | Dan McGee <dan@archlinux.org> | 2011-10-27 15:47:18 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-11-01 10:27:31 -0500 |
commit | ba7a056d586f78954ac874a3bebc6325f7e6eeb1 (patch) | |
tree | 03172fa34a61ab78d24c0b46747aaff9ca4c4875 /lib/libalpm/dload.c | |
parent | a4ce3edf95f148bc6eac16b6edd9bc281c7745af (diff) | |
download | pacman-ba7a056d586f78954ac874a3bebc6325f7e6eeb1.tar.xz |
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/dload.c')
-rw-r--r-- | lib/libalpm/dload.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index efd469d5..76bb00f9 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -306,9 +306,7 @@ static FILE *create_tempfile(struct dload_payload *payload, const char *localpat fchmod(fd, ~(_getumask()) & 0666) || !(fp = fdopen(fd, payload->tempfile_openmode))) { unlink(randpath); - if(fd >= 0) { - close(fd); - } + CLOSE(fd); _alpm_log(payload->handle, ALPM_LOG_ERROR, _("failed to create temporary file for download\n")); return NULL; |