diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-01-23 15:58:24 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-01-23 15:58:24 +0000 |
commit | aae36ab297feb6e934f478e7655c123d928651a7 (patch) | |
tree | 9e9fd41b742242b1e199f22605bd715e2ace8834 | |
parent | 787d104bd528c47140b6e6f25b30682a02db60a5 (diff) | |
download | skalibs-aae36ab297feb6e934f478e7655c123d928651a7.tar.gz skalibs-aae36ab297feb6e934f478e7655c123d928651a7.tar.xz skalibs-aae36ab297feb6e934f478e7655c123d928651a7.zip |
Bugfixes: v2.2.1.0
- seek_set now uses SEEK_SET (those functions are useless now, they will go at the next major version update) - skaclient_server_init now correctly sanitizes unixmessage_timed_receive
-rw-r--r-- | src/libstddjb/seek_set.c | 5 | ||||
-rw-r--r-- | src/libunixonacid/skaclient_server_init.c | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/libstddjb/seek_set.c b/src/libstddjb/seek_set.c index b5883ac..70f6b0d 100644 --- a/src/libstddjb/seek_set.c +++ b/src/libstddjb/seek_set.c @@ -4,10 +4,7 @@ #include <unistd.h> #include <skalibs/djbunix.h> -#define SET 0 /* sigh */ - int seek_set (int fd, long pos) { - if (lseek(fd, (off_t) pos, SET) == -1) return -1 ; - return 0 ; + return lseek(fd, (off_t) pos, SEEK_SET) ; } diff --git a/src/libunixonacid/skaclient_server_init.c b/src/libunixonacid/skaclient_server_init.c index e44d0da..86eb003 100644 --- a/src/libunixonacid/skaclient_server_init.c +++ b/src/libunixonacid/skaclient_server_init.c @@ -1,5 +1,6 @@ /* ISC license. */ +#include <skalibs/allreadwrite.h> #include <skalibs/skaclient.h> #include <skalibs/tai.h> #include <skalibs/unixmessage.h> @@ -7,7 +8,7 @@ int skaclient_server_init (unixmessage_receiver_t *in, unixmessage_sender_t *out, unixmessage_sender_t *asyncout, char const *before, unsigned int beforelen, char const *after, unsigned int afterlen, tain_t const *deadline, tain_t *stamp) { unixmessage_t m ; - return (unixmessage_timed_receive(in, &m, deadline, stamp) >= 0) + return (sanitize_read(unixmessage_timed_receive(in, &m, deadline, stamp)) >= 0) && skaclient_server_ack(&m, out, asyncout, before, beforelen, after, afterlen) && unixmessage_sender_timed_flush(out, deadline, stamp) ; } |