X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Frc.c;h=1744c4166d20d6d6bfafd2b5fd5488a2f4e424fe;hb=f5172902bc9d92451c83dc3c1a85b5aeb975b43a;hp=2d2f22778a29a18ce8155593786b697fd4ad0da9;hpb=633ae13c80d40b0f30db73e520c08cf365d2f8a3;p=libguestfs.git diff --git a/fish/rc.c b/fish/rc.c index 2d2f227..1744c41 100644 --- a/fish/rc.c +++ b/fish/rc.c @@ -71,6 +71,7 @@ receive_stdout (int s) } /* Don't specify a source */ + memset (&msg, 0, sizeof msg); msg.msg_name = NULL; msg.msg_namelen = 0; @@ -118,6 +119,7 @@ send_stdout (int s) char buf[1]; /* Don't specify a destination */ + memset (&msg, 0, sizeof msg); msg.msg_name = NULL; msg.msg_namelen = 0; @@ -198,7 +200,12 @@ rc_listen (void) if (pid > 0) { /* Parent process. */ - printf ("GUESTFISH_PID=%d; export GUESTFISH_PID\n", pid); + + if (!remote_control_csh) + printf ("GUESTFISH_PID=%d; export GUESTFISH_PID\n", pid); + else + printf ("setenv GUESTFISH_PID %d\n", pid); + fflush (stdout); _exit (0); } @@ -279,7 +286,7 @@ rc_listen (void) } /* Run the command. */ - reply.r = issue_command (call.cmd, argv, NULL); + reply.r = issue_command (call.cmd, argv, NULL, 0); xdr_free ((xdrproc_t) xdr_guestfish_call, (char *) &call);