summary refs log tree commit diff
path: root/src/minutils/s6-uevent-listener.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-03-10 11:08:35 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-03-10 11:08:35 +0000
commit51480bfc45525f48428520799925e03a60af4841 (patch)
treecbde03d75f7d94baed2ffbcb7be534032a77e2c5 /src/minutils/s6-uevent-listener.c
parent15a446f9a52094aad070c91b89898a458eff5e7b (diff)
downloads6-linux-utils-51480bfc45525f48428520799925e03a60af4841.tar.gz
s6-linux-utils-51480bfc45525f48428520799925e03a60af4841.tar.xz
s6-linux-utils-51480bfc45525f48428520799925e03a60af4841.zip
It will work better if I *write* into an output buffer...
Diffstat (limited to 'src/minutils/s6-uevent-listener.c')
-rw-r--r--src/minutils/s6-uevent-listener.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/minutils/s6-uevent-listener.c b/src/minutils/s6-uevent-listener.c
index d91c17d..14a48f1 100644
--- a/src/minutils/s6-uevent-listener.c
+++ b/src/minutils/s6-uevent-listener.c
@@ -111,7 +111,7 @@ static inline void handle_netlink (void)
   } ;
   siovec_t v[2] ;
   register int r ;
-  buffer_rpeek(&b1, v) ;
+  buffer_wpeek(&b1, v) ;
   siovec_trunc(v, 2, siovec_len(v, 2) - 1) ;
   iovec_from_siovec(iov, v, 2) ;
   r = sanitize_read(fd_recvmsg(0, &msg)) ;
@@ -137,9 +137,9 @@ static inline void handle_netlink (void)
       fmt[uint_fmt(fmt, nl.nl_pid)] = 0 ;
       strerr_warnw3x("netlink message", " from userspace process ", fmt) ;
     }
-    buffer_unput(&b1, r) ;
     return ;
   }
+  buffer_wseek(&b1, r) ;
   buffer_putnoflush(&b1, "", 1) ;
 }