chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
import: add image verification using gpg
[elogind.git]
/
src
/
shared
/
async.c
diff --git
a/src/shared/async.c
b/src/shared/async.c
index 3876deda70c9954eefa3c43ba5915b3471a4a48f..115901e637f18e532c381c1f40ceb3bcaff7ff2a 100644
(file)
--- a/
src/shared/async.c
+++ b/
src/shared/async.c
@@
-73,7
+73,7
@@
int asynchronous_sync(void) {
}
static void *close_thread(void *p) {
}
static void *close_thread(void *p) {
-
safe_close(PTR_TO_INT(p)
);
+
assert_se(close_nointr(PTR_TO_INT(p)) != -EBADF
);
return NULL;
}
return NULL;
}
@@
-86,9
+86,13
@@
int asynchronous_close(int fd) {
* but it doesn't, so we work around it, and hide this as a
* far away as we can. */
* but it doesn't, so we work around it, and hide this as a
* far away as we can. */
- r = asynchronous_job(close_thread, INT_TO_PTR(fd));
- if (r < 0)
- safe_close(fd);
+ if (fd >= 0) {
+ PROTECT_ERRNO;
+
+ r = asynchronous_job(close_thread, INT_TO_PTR(fd));
+ if (r < 0)
+ assert_se(close_nointr(fd) != -EBADF);
+ }
return -1;
}
return -1;
}