diff options
author | Daniel Mack <github@zonque.org> | 2015-11-17 09:33:59 +0100 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-11-17 09:33:59 +0100 |
commit | bf7e619b3b2b97ff2a4952ab125c794c0d3bdb5f (patch) | |
tree | 9b94bf28557da6f2d5a78da20c44b5da9b8e8676 /src/basic/fd-util.h | |
parent | f1f8a5a5e110f485257e8702ad30b9997e529a74 (diff) | |
parent | 6059dab8897ecd24a51a6601499c1bb9002bc54a (diff) |
Merge pull request #1924 from poettering/some-fixes-2
casting fixes, another siphash24 alignment fix, and more
Diffstat (limited to 'src/basic/fd-util.h')
-rw-r--r-- | src/basic/fd-util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index 1ca10f0383..0e9182d75b 100644 --- a/src/basic/fd-util.h +++ b/src/basic/fd-util.h @@ -28,6 +28,10 @@ #include "macro.h" +/* Make sure we can distinguish fd 0 and NULL */ +#define FD_TO_PTR(fd) INT_TO_PTR((fd)+1) +#define PTR_TO_FD(p) (PTR_TO_INT(p)-1) + int close_nointr(int fd); int safe_close(int fd); void safe_close_pair(int p[]); |