Merge branch 'refs/heads/t/format-signedness'
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index 5f933c5b31e440438acce2e9179121db66c0600e..0946b6df3b0766f82f95f0cd100f039753543350 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -1024,6 +1024,13 @@ __noreturn void afs_init(uint32_t cookie, int socket_fd)
        register_command_task(cookie, &s);
        s.default_timeout.tv_sec = 0;
        s.default_timeout.tv_usec = 999 * 1000;
+       ret = write(socket_fd, "\0", 1);
+       if (ret != 1) {
+               if (ret == 0)
+                       errno = EINVAL;
+               ret = -ERRNO_TO_PARA_ERROR(errno);
+               goto out_close;
+       }
        ret = schedule(&s);
        sched_shutdown(&s);
 out_close: