aboutsummaryrefslogtreecommitdiff
path: root/slirp/misc.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-11-10 17:45:39 +0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-01-14 00:40:54 +0100
commit3ed9f823c688c0dd5dd8d2c936329168c4859d02 (patch)
treeecb05a808d31a1a7713257ddf5393a85430bbea4 /slirp/misc.c
parent7765bee0e3bf5c5e0f396337b341c657fc1152c9 (diff)
downloadqemu-arm-3ed9f823c688c0dd5dd8d2c936329168c4859d02.tar.gz
slirp: use a dedicated field for chardev pointer
Let's not mix command line and chardev pointers. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/misc.c')
-rw-r--r--slirp/misc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/slirp/misc.c b/slirp/misc.c
index 8f0b6004bd..2784fc420f 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -37,7 +37,7 @@ remque(void *a)
element->qh_rlink = NULL;
}
-int add_exec(struct ex_list **ex_ptr, int do_pty, char *exec,
+int add_exec(struct ex_list **ex_ptr, void *chardev, const char *cmdline,
struct in_addr addr, int port)
{
struct ex_list *tmp_ptr;
@@ -50,11 +50,14 @@ int add_exec(struct ex_list **ex_ptr, int do_pty, char *exec,
}
tmp_ptr = *ex_ptr;
- *ex_ptr = g_new(struct ex_list, 1);
+ *ex_ptr = g_new0(struct ex_list, 1);
(*ex_ptr)->ex_fport = port;
(*ex_ptr)->ex_addr = addr;
- (*ex_ptr)->ex_chardev = do_pty == 3;
- (*ex_ptr)->ex_exec = (do_pty == 3) ? exec : g_strdup(exec);
+ if (chardev) {
+ (*ex_ptr)->ex_chardev = chardev;
+ } else {
+ (*ex_ptr)->ex_exec = g_strdup(cmdline);
+ }
(*ex_ptr)->ex_next = tmp_ptr;
return 0;
}