chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
log: explicitly ignore return value of parse_proc_cmdline()
[elogind.git]
/
src
/
shared
/
logs-show.c
diff --git
a/src/shared/logs-show.c
b/src/shared/logs-show.c
index c3578ac9181ca65d63177bf57b3dafbb4210407c..e33824be4a0a704c57f263b313aa80e92c3485c2 100644
(file)
--- a/
src/shared/logs-show.c
+++ b/
src/shared/logs-show.c
@@
-301,8
+301,8
@@
static int output_short(
}
fprintf(f, "[%5llu.%06llu]",
}
fprintf(f, "[%5llu.%06llu]",
-
t / USEC_PER_SEC
,
-
t % USEC_PER_SEC
);
+
(unsigned long long) (t / USEC_PER_SEC)
,
+
(unsigned long long) (t % USEC_PER_SEC)
);
n += 1 + 5 + 1 + 6 + 1;
n += 1 + 5 + 1 + 6 + 1;
@@
-311,8
+311,10
@@
static int output_short(
uint64_t x;
time_t t;
struct tm tm;
uint64_t x;
time_t t;
struct tm tm;
+ struct tm *(*gettime_r)(const time_t *, struct tm *);
r = -ENOENT;
r = -ENOENT;
+ gettime_r = (flags & OUTPUT_UTC) ? gmtime_r : localtime_r;
if (realtime)
r = safe_atou64(realtime, &x);
if (realtime)
r = safe_atou64(realtime, &x);
@@
-329,17
+331,17
@@
static int output_short(
switch(mode) {
case OUTPUT_SHORT_ISO:
switch(mode) {
case OUTPUT_SHORT_ISO:
- r = strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S%z",
local
time_r(&t, &tm));
+ r = strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S%z",
get
time_r(&t, &tm));
break;
case OUTPUT_SHORT_PRECISE:
break;
case OUTPUT_SHORT_PRECISE:
- r = strftime(buf, sizeof(buf), "%b %d %H:%M:%S",
local
time_r(&t, &tm));
+ r = strftime(buf, sizeof(buf), "%b %d %H:%M:%S",
get
time_r(&t, &tm));
if (r > 0) {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
if (r > 0) {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
- ".%06llu",
x % USEC_PER_SEC
);
+ ".%06llu",
(unsigned long long) (x % USEC_PER_SEC)
);
}
break;
default:
}
break;
default:
- r = strftime(buf, sizeof(buf), "%b %d %H:%M:%S",
local
time_r(&t, &tm));
+ r = strftime(buf, sizeof(buf), "%b %d %H:%M:%S",
get
time_r(&t, &tm));
}
if (r <= 0) {
}
if (r <= 0) {
@@
-363,7
+365,7
@@
static int output_short(
fprintf(f, " %.*s", (int) comm_len, comm);
n += comm_len + 1;
} else
fprintf(f, " %.*s", (int) comm_len, comm);
n += comm_len + 1;
} else
- fput
c(' '
, f);
+ fput
s(" unknown"
, f);
if (pid && shall_print(pid, pid_len, flags)) {
fprintf(f, "[%.*s]", (int) pid_len, pid);
if (pid && shall_print(pid, pid_len, flags)) {
fprintf(f, "[%.*s]", (int) pid_len, pid);
@@
-445,6
+447,8
@@
static int output_verbose(
}
fprintf(f, "%s [%s]\n",
}
fprintf(f, "%s [%s]\n",
+ flags & OUTPUT_UTC ?
+ format_timestamp_us_utc(ts, sizeof(ts), realtime) :
format_timestamp_us(ts, sizeof(ts), realtime),
cursor);
format_timestamp_us(ts, sizeof(ts), realtime),
cursor);
@@
-695,7
+699,7
@@
static int output_json(
sd_id128_to_string(boot_id, sid));
}
sd_id128_to_string(boot_id, sid));
}
- h = hashmap_new(
string_hash_func, string_compare_func
);
+ h = hashmap_new(
&string_hash_ops
);
if (!h)
return -ENOMEM;
if (!h)
return -ENOMEM;
@@
-1032,7
+1036,7
@@
static int show_journal(FILE *f,
if (!(flags & OUTPUT_FOLLOW))
break;
if (!(flags & OUTPUT_FOLLOW))
break;
- r = sd_journal_wait(j,
(usec_t) -1
);
+ r = sd_journal_wait(j,
USEC_INFINITY
);
if (r < 0)
goto finish;
if (r < 0)
goto finish;
@@
-1151,7
+1155,7
@@
static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
assert(machine);
assert(boot_id);
assert(machine);
assert(boot_id);
- if (!
filename_is_safe
(machine))
+ if (!
machine_name_is_valid
(machine))
return -EINVAL;
r = container_get_leader(machine, &pid);
return -EINVAL;
r = container_get_leader(machine, &pid);