chiark / gitweb /
util: rename parse_usec() to parse_sec() sinds the default unit is seconds
[elogind.git] / src / journal / journalctl.c
index 3ae6482e99ff8b0d860ecbd2060fe7b7fb7ca31c..642e20d43fbbb0d705977ae4b96356e595d3ac41 100644 (file)
@@ -355,7 +355,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_INTERVAL:
-                        r = parse_usec(optarg, &arg_interval);
+                        r = parse_sec(optarg, &arg_interval);
                         if (r < 0 || arg_interval <= 0) {
                                 log_error("Failed to parse sealing key change interval: %s", optarg);
                                 return -EINVAL;
@@ -562,7 +562,7 @@ static int add_matches(sd_journal *j, char **args) {
                         else if (S_ISBLK(st.st_mode))
                                 asprintf(&t, "_KERNEL_DEVICE=b%u:%u", major(st.st_rdev), minor(st.st_rdev));
                         else {
-                                log_error("File is not a device node, regular file or is not executable: %s", *i);
+                                log_error("File is neither a device node, nor regular file, nor executable: %s", *i);
                                 return -EINVAL;
                         }
 
@@ -1032,11 +1032,16 @@ int main(int argc, char *argv[]) {
             arg_action == ACTION_LIST_CATALOG ||
             arg_action == ACTION_DUMP_CATALOG) {
 
-                char _cleanup_free_ *database;
-                database =  strjoin(arg_root, "/", CATALOG_DATABASE, NULL);
-                if (!database) {
-                        r = log_oom();
-                        goto finish;
+                const char* database = CATALOG_DATABASE;
+                char _cleanup_free_ *copy = NULL;
+                if (arg_root) {
+                        copy = strjoin(arg_root, "/", CATALOG_DATABASE, NULL);
+                        if (!database) {
+                                r = log_oom();
+                                goto finish;
+                        }
+                        path_kill_slashes(copy);
+                        database = copy;
                 }
 
                 if (arg_action == ACTION_UPDATE_CATALOG) {