X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=ltt-sessiond%2Fust-comm.c;fp=ltt-sessiond%2Fust-comm.c;h=0000000000000000000000000000000000000000;hp=4a54bf78429e0172a1c7ddfbaa385c0aa98f1a74;hb=2bdd86d4c47902237c691d3c5409f32f205df81e;hpb=f2fc6720dff91c4076318acff69aa3bb5e70060a diff --git a/ltt-sessiond/ust-comm.c b/ltt-sessiond/ust-comm.c deleted file mode 100644 index 4a54bf784..000000000 --- a/ltt-sessiond/ust-comm.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2011 - David Goulet - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; only version 2 - * of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include "ust-comm.h" - -/* - * Send msg containing a command to an UST application via sock and wait for - * the reply. Caller must free() the reply structure sent back. - * - * Return the replied structure or NULL. - */ -struct lttcomm_ust_reply *ustcomm_send_command(int sock, - struct lttcomm_ust_msg *msg) -{ - ssize_t len; - struct lttcomm_ust_reply *reply; - - /* Extra safety */ - if (msg == NULL || sock < 0) { - goto error; - } - - DBG2("Sending UST command %d to sock %d", msg->cmd, sock); - - /* Send UST msg */ - len = ustcomm_send_unix_sock(sock, msg, sizeof(*msg)); - if (len < 0) { - goto error; - } - - reply = malloc(sizeof(struct lttcomm_ust_reply)); - if (reply == NULL) { - perror("malloc ust reply"); - goto error; - } - - DBG2("Receiving UST reply on sock %d", sock); - - /* Get UST reply */ - len = ustcomm_recv_unix_sock(sock, reply, sizeof(*reply)); - if (len < 0 || len < sizeof(*reply)) { - goto error; - } - - return reply; - -error: - return NULL; -}