Improve the noise collection for the internal random pool.
[sgt/putty] / unix / uxplink.c
index dab6947..ba7b78f 100644 (file)
@@ -111,6 +111,9 @@ void try_output(int is_stderr)
     void *senddata;
     int sendlen, ret;
 
+    if (bufchain_size(chain) == 0)
+        return;
+
     bufchain_prefix(chain, &senddata, &sendlen);
     ret = write(fd, senddata, sendlen);
     if (ret > 0)
@@ -581,5 +584,6 @@ int main(int argc, char **argv)
        fprintf(stderr, "Remote process exit code unavailable\n");
        exitcode = 1;                  /* this is an error condition */
     }
-    return exitcode;
+    cleanup_exit(exitcode);
+    return exitcode;                  /* shouldn't happen, but placates gcc */
 }