From: Richard W.M. Jones Date: Tue, 3 Jan 2012 17:40:55 +0000 (+0000) Subject: Fix connection close. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6d0ffdb7821c34fb807ddd277c216a050a479284;p=wrappi.git Fix connection close. --- diff --git a/daemon/wrappid.c b/daemon/wrappid.c index d6ce2b4..c15b46c 100644 --- a/daemon/wrappid.c +++ b/daemon/wrappid.c @@ -67,7 +67,9 @@ main_loop (void) xdrstdio_create (&xdr, stdin, XDR_DECODE); memset (&hdr, 0, sizeof hdr); if (!wrap_int_xdr_message_header (&xdr, &hdr)) { - fprintf (stderr, "error receiving request header\n"); + /* No error message here, because this is the expected + * exit place when the connection is closed. + */ xdr_destroy (&xdr); return; } diff --git a/lib/wrappi.c b/lib/wrappi.c index 6c31c70..3799c5d 100644 --- a/lib/wrappi.c +++ b/lib/wrappi.c @@ -42,15 +42,15 @@ wrap_create (void) void wrap_close (wrap_h *w) { - if (w->pid) - waitpid (w->pid, NULL, 0); - if (w->rfp != NULL) fclose (w->rfp); if (w->wfp != NULL) fclose (w->wfp); + if (w->pid) + waitpid (w->pid, NULL, 0); + free (w->hostname); free (w->wrappid_path); free (w);