diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-08-25 17:34:30 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-08-25 17:34:30 +0100 |
commit | 3dd359c2d34c6abf385d58da863f337b39702585 (patch) | |
tree | 2097c65507985aa466f854093a373d0653572df4 /slirp | |
parent | 33886ebeec0c0ff6253a49253fae0db44c9ed0f3 (diff) | |
parent | 40a87c6c9b11ef9c14e0301f76abf0eb2582f08e (diff) |
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-08-24' into staging
trivial patches for 2014-08-24
# gpg: Signature made Sun 24 Aug 2014 14:28:49 BST using RSA key ID A4C3D7DB
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg: aka "Michael Tokarev <mjt@corpit.ru>"
# gpg: aka "Michael Tokarev <mjt@debian.org>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5
# Subkey fingerprint: 6F67 E18E 7C91 C5B1 5514 66A7 BEE5 9D74 A4C3 D7DB
* remotes/mjt/tags/trivial-patches-2014-08-24:
vmxnet3: Pad short frames to minimum size (60 bytes)
libdecnumber: Fix warnings from smatch (missing static, boolean operations)
linux-user: fix file descriptor leaks
po: Fix Makefile rules for in-tree builds without configuration
slirp/misc: Use the GLib memory allocation APIs
configure: no need to mkdir QMP
dma: axidma: Variablise repeated s->streams[i] sub-expr
microblaze: ml605: Get rid of ddr_base variable
tests/bios-tables-test: check the value returned by fopen()
tcg: dump op count into qemu log
util/path: Use the GLib memory allocation routines
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'slirp')
-rw-r--r-- | slirp/misc.c | 20 | ||||
-rw-r--r-- | slirp/misc.h | 4 | ||||
-rw-r--r-- | slirp/slirp_config.h | 3 |
3 files changed, 3 insertions, 24 deletions
diff --git a/slirp/misc.c b/slirp/misc.c index b8eb74cab0..6543dc7772 100644 --- a/slirp/misc.c +++ b/slirp/misc.c @@ -54,11 +54,11 @@ int add_exec(struct ex_list **ex_ptr, int do_pty, char *exec, } tmp_ptr = *ex_ptr; - *ex_ptr = (struct ex_list *)malloc(sizeof(struct ex_list)); + *ex_ptr = g_new(struct ex_list, 1); (*ex_ptr)->ex_fport = port; (*ex_ptr)->ex_addr = addr; (*ex_ptr)->ex_pty = do_pty; - (*ex_ptr)->ex_exec = (do_pty == 3) ? exec : strdup(exec); + (*ex_ptr)->ex_exec = (do_pty == 3) ? exec : g_strdup(exec); (*ex_ptr)->ex_next = tmp_ptr; return 0; } @@ -187,7 +187,7 @@ fork_exec(struct socket *so, const char *ex, int do_pty) bptr++; c = *bptr; *bptr++ = (char)0; - argv[i++] = strdup(curarg); + argv[i++] = g_strdup(curarg); } while (c); argv[i] = NULL; @@ -228,20 +228,6 @@ fork_exec(struct socket *so, const char *ex, int do_pty) } #endif -#ifndef HAVE_STRDUP -char * -strdup(str) - const char *str; -{ - char *bptr; - - bptr = (char *)malloc(strlen(str)+1); - strcpy(bptr, str); - - return bptr; -} -#endif - void slirp_connection_info(Slirp *slirp, Monitor *mon) { const char * const tcpstates[] = { diff --git a/slirp/misc.h b/slirp/misc.h index ba8beb1b17..41a32583da 100644 --- a/slirp/misc.h +++ b/slirp/misc.h @@ -16,10 +16,6 @@ struct ex_list { struct ex_list *ex_next; }; -#ifndef HAVE_STRDUP -char *strdup(const char *); -#endif - #define EMU_NONE 0x0 /* TCP emulations */ diff --git a/slirp/slirp_config.h b/slirp/slirp_config.h index 18db45c8e4..896d8022eb 100644 --- a/slirp/slirp_config.h +++ b/slirp/slirp_config.h @@ -72,9 +72,6 @@ /* Define if you have strerror */ #define HAVE_STRERROR -/* Define if you have strdup() */ -#define HAVE_STRDUP - /* Define according to how time.h should be included */ #define TIME_WITH_SYS_TIME 0 #undef HAVE_SYS_TIME_H |