Fix: lttng: incorrect domain list printed when no domain is provided
[lttng-tools.git] / src / bin / lttng / commands / track-untrack.c
index da515b1a9c1d6b189ddb9bfc89bd667b96012f54..c11f46f2fd0ee82bb924a0d4fe51296a4f074870 100644 (file)
@@ -131,6 +131,11 @@ int parse_pid_string(const char *_pid_string,
                /* For next loop */
                one_pid_str = strtok_r(NULL, ",", &iter);
        }
+       if (count == 0) {
+               ERR("Fatal error occurred when parsing pid string");
+               retval = CMD_ERROR;
+               goto error;
+       }
 
        free(pid_string);
        /* Identity of delimiter has been lost in first pass. */
@@ -257,8 +262,14 @@ enum cmd_error_code track_untrack_pid(enum cmd_type cmd_type, const char *cmd_st
                                break;
                        }
                } else {
-                       MSG("PID %i %sed in session %s",
-                                       pid_list[i], cmd_str, session_name);
+                       if (pid_list[i] != -1) {
+                               MSG("PID %i %sed in session %s",
+                                               pid_list[i], cmd_str,
+                                               session_name);
+                       } else {
+                               MSG("All PIDs %sed in session %s",
+                                               cmd_str, session_name);
+                       }
                        success = 1;
                }
 
@@ -355,7 +366,8 @@ int cmd_track_untrack(enum cmd_type cmd_type, const char *cmd_str,
                }
        }
 
-       ret = print_missing_or_multiple_domains(opt_kernel + opt_userspace);
+       ret = print_missing_or_multiple_domains(
+                       opt_kernel + opt_userspace, false);
        if (ret) {
                command_ret = CMD_ERROR;
                goto end;
This page took 0.025421 seconds and 4 git commands to generate.