From 6d0ffdb7821c34fb807ddd277c216a050a479284 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 3 Jan 2012 17:40:55 +0000 Subject: [PATCH] Fix connection close. --- daemon/wrappid.c | 4 +++- lib/wrappi.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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); -- 1.8.3.1