summaryrefslogtreecommitdiff
path: root/src/libs6/ftrigw_notifyb_nosig.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-07-21 16:42:59 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-07-21 16:42:59 +0000
commit6305fe2580781df44e93c1ec8ed380896680960d (patch)
treeefb5c2c3ebe26118fed1e10d80874784060893f3 /src/libs6/ftrigw_notifyb_nosig.c
parent3ea0b28892de170c5de281529613531dfa15eaa8 (diff)
downloads6-6305fe2580781df44e93c1ec8ed380896680960d.tar.xz
Adapt to skalibs-2.7.0.0
Diffstat (limited to 'src/libs6/ftrigw_notifyb_nosig.c')
-rw-r--r--src/libs6/ftrigw_notifyb_nosig.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libs6/ftrigw_notifyb_nosig.c b/src/libs6/ftrigw_notifyb_nosig.c
index 0ba38a6..38110f2 100644
--- a/src/libs6/ftrigw_notifyb_nosig.c
+++ b/src/libs6/ftrigw_notifyb_nosig.c
@@ -3,6 +3,7 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
+#include <skalibs/posixplz.h>
#include <skalibs/direntry.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/djbunix.h>
@@ -32,14 +33,14 @@ int ftrigw_notifyb_nosig (char const *path, char const *s, size_t len)
fd = open_write(tmp) ;
if (fd == -1)
{
- if (errno == ENXIO) unlink(tmp) ;
+ if (errno == ENXIO) unlink_void(tmp) ;
}
else
{
ssize_t r = fd_write(fd, s, len) ;
if ((r < 0) || (size_t)r < len)
{
- if (errno == EPIPE) unlink(tmp) ;
+ if (errno == EPIPE) unlink_void(tmp) ;
/* what to do if EGAIN ? full fifo -> fix the reader !
There's a race condition in extreme cases though ;
but it's still better to be nonblocking - the writer
@@ -54,9 +55,6 @@ int ftrigw_notifyb_nosig (char const *path, char const *s, size_t len)
}
}
}
- {
- int e = errno ;
- dir_close(dir) ;
- return e ? (errno = e, -1) : (int)i ;
- }
+ dir_close(dir) ;
+ return errno ? -1 : (int)i ;
}