index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
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/util.h | |
parent | a4ce3edf95f148bc6eac16b6edd9bc281c7745af (diff) |
-rw-r--r-- | lib/libalpm/util.h | 12 |
diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index 8d20a281..36e4960f 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -35,10 +35,13 @@ #include <string.h> #include <stdarg.h> #include <stddef.h> /* size_t */ +#include <sys/types.h> #include <sys/stat.h> /* struct stat */ -#include <archive.h> /* struct archive */ #include <math.h> /* fabs */ #include <float.h> /* DBL_EPSILON */ +#include <fcntl.h> /* open, close */ + +#include <archive.h> /* struct archive */ #ifdef ENABLE_NLS #include <libintl.h> /* here so it doesn't need to be included elsewhere */ @@ -81,6 +84,13 @@ #define ALPM_BUFFER_SIZE 8192 #endif +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#define OPEN(fd, path, flags) do { fd = open(path, flags | O_BINARY); } while(fd == -1 && errno == EINTR) +#define CLOSE(fd) do { int ret; do { ret = close(fd); } while(ret == -1 && errno == EINTR); } while(0) + /** * Used as a buffer/state holder for _alpm_archive_fgets(). */ |