chiark / gitweb /
String-termination bugfix. Compilation fixes (-D_GNU_SOURCE, etc.), and some config...
[userv.git] / client.c
index bc554128cff66cadc40098d6d4e2566edd2a2428..d201bef428672b9b84683082b990b886f514700e 100644 (file)
--- a/client.c
+++ b/client.c
@@ -378,6 +378,7 @@ static void sighandler_chld(int ignored) /* DOES return, unlike in daemon */ {
        memset(&event_mbuf,0,sizeof(event_mbuf));
        event_mbuf.magic= EVENT_MAGIC;
        event_mbuf.type= et_closereadfd;
+        event_mbuf.data.closereadfd.fd= fd;
        r= fwrite(&event_mbuf,1,sizeof(event_mbuf),swfile);
        if (r != sizeof(event_mbuf) || fflush(swfile))
          if (errno != EPIPE) syscallerror("inform service of closed read fd");
@@ -737,13 +738,14 @@ static void callvalueoption(const struct optioninfo *oip, char *arg) {
   char *equals;
   if (oip->values == 2) {
     equals= strchr(arg,'=');
-    if (!equals)
+    if (!equals) {
       if (oip->abbrev)
         usageerror("option --%s (-%c) passed argument `%s' with no `='",
                    oip->full,oip->abbrev,arg);
       else
         usageerror("option --%s passed argument `%s' with no `='",
                    oip->full,arg);
+    }
     *equals++= 0;
     (oip->fn)(oip,equals,arg);
   } else {