chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: replace close_nointr_nofail() by a more useful safe_close()
[elogind.git]
/
src
/
journal
/
test-mmap-cache.c
diff --git
a/src/journal/test-mmap-cache.c
b/src/journal/test-mmap-cache.c
index e2ffaf4723b290eaa99dd15dbb731e38974c86a0..b7bb260fcfdce9516c4ce010b763861c240d5e34 100644
(file)
--- a/
src/journal/test-mmap-cache.c
+++ b/
src/journal/test-mmap-cache.c
@@
-22,6
+22,7
@@
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <unistd.h>
+#include <fcntl.h>
#include "log.h"
#include "macro.h"
#include "log.h"
#include "macro.h"
@@
-36,15
+37,15
@@
int main(int argc, char *argv[]) {
assert_se(m = mmap_cache_new());
assert_se(m = mmap_cache_new());
- x = mk
stemp(px
);
+ x = mk
ostemp_safe(px, O_RDWR|O_CLOEXEC
);
assert(x >= 0);
unlink(px);
assert(x >= 0);
unlink(px);
- y = mk
stemp(py
);
+ y = mk
ostemp_safe(py, O_RDWR|O_CLOEXEC
);
assert(y >= 0);
unlink(py);
assert(y >= 0);
unlink(py);
- z = mk
stemp(pz
);
+ z = mk
ostemp_safe(pz, O_RDWR|O_CLOEXEC
);
assert(z >= 0);
unlink(pz);
assert(z >= 0);
unlink(pz);
@@
-71,9
+72,9
@@
int main(int argc, char *argv[]) {
mmap_cache_unref(m);
mmap_cache_unref(m);
-
close_nointr_nofail
(x);
-
close_nointr_nofail
(y);
-
close_nointr_nofail
(z);
+
safe_close
(x);
+
safe_close
(y);
+
safe_close
(z);
return 0;
}
return 0;
}