Update version to 0.16
[ust.git] / ustctl / scanning_functions.c
index 0cf809e061a126ac57f6699c21d48756f7d006e1..4aa8c1c93e81cf7c6cd675692129dd84c859c023 100644 (file)
 
 #define _GNU_SOURCE
 #include <stdio.h>
-#include <ust/ustcmd.h>
+#include <ust/ustctl.h>
 #include "usterr.h"
 
 
-pid_t parse_pid(const char *pid_string)
+int parse_and_connect_pid(const char *pid_string)
 {
        pid_t pid;
+       int sock;
 
        errno = 0;
        pid = strtoull(pid_string, NULL, 10);
@@ -32,7 +33,13 @@ pid_t parse_pid(const char *pid_string)
                exit(EXIT_FAILURE);
        }
 
-       return pid;
+       sock = ustctl_connect_pid(pid);
+       if (sock < 0) {
+               perror("Failed to connect to process");
+               exit(EXIT_FAILURE);
+       }
+
+       return sock;
 }
 
 int scan_ch_marker(const char *channel_marker, char **channel, char **marker)
This page took 0.022822 seconds and 4 git commands to generate.