git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ruby: Append newline character after printing exception in callback.
[libguestfs.git]
/
fish
/
rc.c
diff --git
a/fish/rc.c
b/fish/rc.c
index
dbaf953
..
1744c41
100644
(file)
--- a/
fish/rc.c
+++ b/
fish/rc.c
@@
-71,6
+71,7
@@
receive_stdout (int s)
}
/* Don't specify a source */
}
/* Don't specify a source */
+ memset (&msg, 0, sizeof msg);
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
@@
-118,6
+119,7
@@
send_stdout (int s)
char buf[1];
/* Don't specify a destination */
char buf[1];
/* Don't specify a destination */
+ memset (&msg, 0, sizeof msg);
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_name = NULL;
msg.msg_namelen = 0;
@@
-177,14
+179,15
@@
rc_listen (void)
char sockpath[128];
pid_t pid;
struct sockaddr_un addr;
char sockpath[128];
pid_t pid;
struct sockaddr_un addr;
- int sock, s, i;
+ int sock, s;
+ size_t i;
FILE *fp;
XDR xdr, xdr2;
guestfish_hello hello;
guestfish_call call;
guestfish_reply reply;
char **argv;
FILE *fp;
XDR xdr, xdr2;
guestfish_hello hello;
guestfish_call call;
guestfish_reply reply;
char **argv;
-
in
t argc;
+
size_
t argc;
memset (&hello, 0, sizeof hello);
memset (&call, 0, sizeof call);
memset (&hello, 0, sizeof hello);
memset (&call, 0, sizeof call);
@@
-197,7
+200,12
@@
rc_listen (void)
if (pid > 0) {
/* Parent process. */
if (pid > 0) {
/* Parent process. */
- printf ("export GUESTFISH_PID=%d\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);
}
fflush (stdout);
_exit (0);
}
@@
-278,7
+286,7
@@
rc_listen (void)
}
/* Run the command. */
}
/* 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);
xdr_free ((xdrproc_t) xdr_guestfish_call, (char *) &call);
@@
-307,7
+315,7
@@
rc_listen (void)
/* Remote control client. */
int
/* Remote control client. */
int
-rc_remote (int pid, const char *cmd,
in
t argc, char *argv[],
+rc_remote (int pid, const char *cmd,
size_
t argc, char *argv[],
int exit_on_error)
{
guestfish_hello hello;
int exit_on_error)
{
guestfish_hello hello;