diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-06-17 22:56:09 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-06-17 22:56:09 +0200 |
commit | 30654aa0d42e1c9e67a286357e0b3b1409e6a4eb (patch) | |
tree | 82824589e237a2167b1f6509e9523d41f8af876b /src | |
parent | 2c8d248c335df9160ed7af2eca968d52e542ae22 (diff) | |
parent | 98d2a5341788b49e82d628dfdc2e241af6d70dcd (diff) |
Merge pull request #271 from poettering/test-journal-stream-crappy-clock
journal: ensure test-journal-stream doesn't get confused by crappy cl…
Diffstat (limited to 'src')
-rw-r--r-- | src/journal/test-journal-stream.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/journal/test-journal-stream.c b/src/journal/test-journal-stream.c index e1146c692d..b5ecf2f375 100644 --- a/src/journal/test-journal-stream.c +++ b/src/journal/test-journal-stream.c @@ -80,6 +80,7 @@ int main(int argc, char *argv[]) { char *z; const void *data; size_t l; + dual_timestamp previous_ts = DUAL_TIMESTAMP_NULL; /* journal_file_open requires a valid machine id */ if (access("/etc/machine-id", F_OK) != 0) @@ -101,6 +102,14 @@ int main(int argc, char *argv[]) { dual_timestamp_get(&ts); + if (ts.monotonic <= previous_ts.monotonic) + ts.monotonic = previous_ts.monotonic + 1; + + if (ts.realtime <= previous_ts.realtime) + ts.realtime = previous_ts.realtime + 1; + + previous_ts = ts; + assert_se(asprintf(&p, "NUMBER=%u", i) >= 0); iovec[0].iov_base = p; iovec[0].iov_len = strlen(p); |