tree-wide: make macros for converting fds to pointers and back generic and use them everywhere

This commit is contained in:
Lennart Poettering
2015-11-17 00:52:10 +01:00
parent b16fee15ff
commit 23e096cc60
6 changed files with 22 additions and 23 deletions
+2 -2
View File
@@ -68,7 +68,7 @@ int asynchronous_sync(void) {
}
static void *close_thread(void *p) {
assert_se(close_nointr(PTR_TO_INT(p)) != -EBADF);
assert_se(close_nointr(PTR_TO_FD(p)) != -EBADF);
return NULL;
}
@@ -84,7 +84,7 @@ int asynchronous_close(int fd) {
if (fd >= 0) {
PROTECT_ERRNO;
r = asynchronous_job(close_thread, INT_TO_PTR(fd));
r = asynchronous_job(close_thread, FD_TO_PTR(fd));
if (r < 0)
assert_se(close_nointr(fd) != -EBADF);
}