X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_channels.c;h=214c8a3621660c8cf83cbd31edf26e7b7c06aebc;hp=9c84d02634c8612740b914c4a1c6d0d5e806b210;hb=7010c0332387eea98b52f301458d481f151840a6;hpb=22a1b9316f04f95a904ea724ad51aabcc389aca0 diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index 9c84d0263..214c8a362 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -535,13 +535,13 @@ int cmd_enable_channels(int argc, const char **argv) } case OPT_MONITOR_TIMER: { - unsigned long long v; + uint64_t v; errno = 0; opt_arg = poptGetOptArg(pc); - v = strtoull(opt_arg, NULL, 0); - if (errno != 0 || !isdigit(opt_arg[0])) { - ERR("Wrong value in --monitor-timer parameter: %s", opt_arg); + + if (utils_parse_time_suffix(opt_arg, &v) < 0) { + ERR("Wrong value for --monitor-timer parameter: %s", opt_arg); ret = CMD_ERROR; goto end; } @@ -552,7 +552,7 @@ int cmd_enable_channels(int argc, const char **argv) } case OPT_BLOCKING_TIMEOUT: { - long long v; /* in usec */ + uint64_t v; long long v_msec; errno = 0; @@ -565,10 +565,8 @@ int cmd_enable_channels(int argc, const char **argv) break; } - v = strtoll(opt_arg, NULL, 0); - if (errno != 0 || (!isdigit(opt_arg[0]) && opt_arg[0] != '-') - || v < 0) { - ERR("Wrong value in --blocking-timeout parameter: %s", opt_arg); + if (utils_parse_time_suffix(opt_arg, &v) < 0) { + ERR("Wrong value for --blocking-timeout parameter: %s", opt_arg); ret = CMD_ERROR; goto end; }