Handle negative time and offset from Epoch
[babeltrace.git] / converter / babeltrace.c
index c53c4800046923a616ef9f6d583fd7753df7b692..326f85686cc6cd5bfab908261e68b24e5128e21b 100644 (file)
@@ -26,8 +26,6 @@
  * SOFTWARE.
  */
 
-#define _GNU_SOURCE
-#include <config.h>
 #include <babeltrace/babeltrace.h>
 #include <babeltrace/format.h>
 #include <babeltrace/context.h>
@@ -351,7 +349,7 @@ static int parse_options(int argc, char **argv)
                                goto end;
                        }
                        errno = 0;
-                       opt_clock_offset = strtoull(str, &endptr, 0);
+                       opt_clock_offset = strtoll(str, &endptr, 0);
                        if (*endptr != '\0' || str == endptr || errno != 0) {
                                fprintf(stderr, "[error] Incorrect --clock-offset argument: %s\n", str);
                                ret = -EINVAL;
@@ -376,7 +374,7 @@ static int parse_options(int argc, char **argv)
                                goto end;
                        }
                        errno = 0;
-                       opt_clock_offset_ns = strtoull(str, &endptr, 0);
+                       opt_clock_offset_ns = strtoll(str, &endptr, 0);
                        if (*endptr != '\0' || str == endptr || errno != 0) {
                                fprintf(stderr, "[error] Incorrect --clock-offset-ns argument: %s\n", str);
                                ret = -EINVAL;
@@ -509,8 +507,6 @@ int bt_context_add_traces_recursive(struct bt_context *ctx, const char *path,
                if (ret < 0) {
                        fprintf(stderr, "[warning] [Context] cannot open trace \"%s\" "
                                        "for reading.\n", path);
-                       /* Allow to skip erroneous traces. */
-                       ret = 1;        /* partial error */
                }
                return ret;
        }
This page took 0.023203 seconds and 4 git commands to generate.