From ce2ccc12dddef07259e349d0b10504585ce6ee20 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Thu, 11 Mar 2010 19:04:22 -0500 Subject: [PATCH] remove pointless strdup_malloc --- libust/tracectl.c | 4 ++-- libustcomm/ustcomm.c | 14 -------------- libustcomm/ustcomm.h | 2 -- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/libust/tracectl.c b/libust/tracectl.c index 882f81a..064b72b 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -707,14 +707,14 @@ static int do_cmd_put_subbuffer(const char *recvbuf, struct ustcomm_source *src) DBG("put_subbuf"); - channel_and_cpu = strdup_malloc(nth_token(recvbuf, 1)); + channel_and_cpu = strdup(nth_token(recvbuf, 1)); if(channel_and_cpu == NULL) { ERR("cannot parse channel"); retval = -1; goto end; } - consumed_old_str = strdup_malloc(nth_token(recvbuf, 2)); + consumed_old_str = strdup(nth_token(recvbuf, 2)); if(consumed_old_str == NULL) { ERR("cannot parse consumed_old"); retval = -1; diff --git a/libustcomm/ustcomm.c b/libustcomm/ustcomm.c index 5dfd2a8..8324f21 100644 --- a/libustcomm/ustcomm.c +++ b/libustcomm/ustcomm.c @@ -86,20 +86,6 @@ static int mkdir_p(const char *path, mode_t mode) return retval; } -char *strdup_malloc(const char *s) -{ - char *retval; - - if(s == NULL) - return NULL; - - retval = (char *) malloc(strlen(s)+1); - - strcpy(retval, s); - - return retval; -} - static int signal_process(pid_t pid) { return 0; diff --git a/libustcomm/ustcomm.h b/libustcomm/ustcomm.h index 841d678..e7e7362 100644 --- a/libustcomm/ustcomm.h +++ b/libustcomm/ustcomm.h @@ -65,8 +65,6 @@ struct ustcomm_multipoll_conn_info { int (*cb)(char *msg, struct ustcomm_source *src); }; -extern char *strdup_malloc(const char *s); - //int send_message_pid(pid_t pid, const char *msg, char **reply); extern int ustcomm_request_consumer(pid_t pid, const char *channel); -- 2.34.1