return 1;
}
-static int process_dunder(JournalImporter *imp, char *line, size_t n) {
+static int process_dunder(JournalImporter *imp, char *line) {
const char *timestamp;
char buf[CELLESCAPE_DEFAULT_LENGTH];
int r;
assert(line);
- assert(n > 0);
- assert(line[n-1] == '\n');
-
- /* XXX: is it worth to support timestamps in extended format?
- * We don't produce them, but who knows... */
timestamp = startswith(line, "__CURSOR=");
if (timestamp)
if (timestamp) {
uint64_t x;
- line[n-1] = '\0';
r = safe_atou64(timestamp, &x);
if (r < 0)
return log_warning_errno(r, "Failed to parse __REALTIME_TIMESTAMP '%s': %m",
if (timestamp) {
uint64_t x;
- line[n-1] = '\0';
r = safe_atou64(timestamp, &x);
if (r < 0)
return log_warning_errno(r, "Failed to parse __MONOTONIC_TIMESTAMP '%s': %m",
return 1;
}
- r = process_dunder(imp, line, n);
- if (r != 0)
- return r < 0 ? r : 0;
-
/* MESSAGE=xxx\n
or
COREDUMP\n
return 0;
}
+ line[n] = '\0';
+ r = process_dunder(imp, line);
+ if (r != 0)
+ return r < 0 ? r : 0;
+
r = iovw_put(&imp->iovw, line, n);
if (r < 0)
return r;