Add listing session option
[lttng-tools.git] / liblttsessiondcomm / liblttsessiondcomm.c
index 9c72a918ccc23d94584df20a3d0bb139b5ce7c6a..adae8410401ba41c19ef4176e8b6aea45cc8a443 100644 (file)
@@ -38,6 +38,8 @@ static const char *lttcomm_readable_code[] = {
        [ LTTCOMM_ERR_INDEX(LTTCOMM_UND) ] = "Undefined command",
        [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_SESSION) ] = "No session found",
        [ LTTCOMM_ERR_INDEX(LTTCOMM_LIST_FAIL) ] = "Unable to list traceable apps",
+       [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_APPS) ] = "No traceable apps found",
+       [ LTTCOMM_ERR_INDEX(LTTCOMM_NO_SESS) ] = "No session found",
 };
 
 /*
@@ -67,27 +69,27 @@ const char *lttcomm_get_readable_code(enum lttcomm_return_code code)
  */
 int lttcomm_connect_unix_sock(const char *pathname)
 {
-    struct sockaddr_un sun;
-    int fd;
+       struct sockaddr_un sun;
+       int fd;
        int ret = 1;
 
-    fd = socket(PF_UNIX, SOCK_STREAM, 0);
+       fd = socket(PF_UNIX, SOCK_STREAM, 0);
        if (fd < 0) {
                perror("socket");
                goto error;
        }
 
-    memset(&sun, 0, sizeof(sun));
-    sun.sun_family = AF_UNIX;
-    strncpy(sun.sun_path, pathname, sizeof(sun.sun_path));
+       memset(&sun, 0, sizeof(sun));
+       sun.sun_family = AF_UNIX;
+       strncpy(sun.sun_path, pathname, sizeof(sun.sun_path));
 
-    ret = connect(fd, (struct sockaddr *) &sun, sizeof(sun));
-    if (ret < 0) {
-        perror("connect");
+       ret = connect(fd, (struct sockaddr *) &sun, sizeof(sun));
+       if (ret < 0) {
+               perror("connect");
                goto error;
-    }
+       }
 
-    return fd;
+       return fd;
 
 error:
        return -1;
This page took 0.024328 seconds and 4 git commands to generate.