From: Pierre-Marc Fournier Date: Fri, 12 Mar 2010 00:04:22 +0000 (-0500) Subject: remove pointless strdup_malloc X-Git-Tag: v1.9.1~642 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ce2ccc12dddef07259e349d0b10504585ce6ee20;p=lttng-ust.git remove pointless strdup_malloc --- diff --git a/libust/tracectl.c b/libust/tracectl.c index 882f81ab..064b72bd 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 5dfd2a8c..8324f21d 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 841d6787..e7e73621 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);