diff options
author | Ruediger Meier | 2016-02-12 14:30:52 +0100 |
---|---|---|
committer | Ruediger Meier | 2016-02-12 14:32:42 +0100 |
commit | c2114018018b836b743265ef6014387952219d94 (patch) | |
tree | 5cceac23f7b4c0d922fd79c647b04bc404eff5a3 /sys-utils/dmesg.c | |
parent | travis: install mdadm (diff) | |
download | kernel-qcow2-util-linux-c2114018018b836b743265ef6014387952219d94.tar.gz kernel-qcow2-util-linux-c2114018018b836b743265ef6014387952219d94.tar.xz kernel-qcow2-util-linux-c2114018018b836b743265ef6014387952219d94.zip |
misc: always cast timeval.tv_usec to long rather than int
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'sys-utils/dmesg.c')
-rw-r--r-- | sys-utils/dmesg.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index fae6f8754..0bf77af8d 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -835,7 +835,7 @@ static char *iso_8601_time(struct dmesg_control *ctl, struct dmesg_record *rec, return buf; } len = strlen(buf); - snprintf(buf + len, bufsiz - len, ",%06d", (int)rec->tv.tv_usec); + snprintf(buf + len, bufsiz - len, ",%06ld", (long)rec->tv.tv_usec); len = strlen(buf); strftime(buf + len, bufsiz - len, "%z", &tm); return buf; @@ -894,10 +894,10 @@ static void print_record(struct dmesg_control *ctl, * backward compatibility with syslog(2) buffers only */ if (ctl->raw) { - ctl->indent = printf("<%d>[%5d.%06d] ", + ctl->indent = printf("<%d>[%5ld.%06ld] ", LOG_MAKEPRI(rec->facility, rec->level), - (int) rec->tv.tv_sec, - (int) rec->tv.tv_usec); + (long) rec->tv.tv_sec, + (long) rec->tv.tv_usec); goto mesg; } @@ -948,11 +948,12 @@ static void print_record(struct dmesg_control *ctl, ctl->lasttm = cur; break; case DMESG_TIMEFTM_TIME: - ctl->indent = printf("[%5d.%06d] ", (int)rec->tv.tv_sec, (int)rec->tv.tv_usec); + ctl->indent = printf("[%5ld.%06ld] ", + (long)rec->tv.tv_sec, (long)rec->tv.tv_usec); break; case DMESG_TIMEFTM_TIME_DELTA: - ctl->indent = printf("[%5d.%06d <%12.06f>] ", (int)rec->tv.tv_sec, - (int)rec->tv.tv_usec, record_count_delta(ctl, rec)); + ctl->indent = printf("[%5ld.%06ld <%12.06f>] ", (long)rec->tv.tv_sec, + (long)rec->tv.tv_usec, record_count_delta(ctl, rec)); break; case DMESG_TIMEFTM_ISO8601: ctl->indent = printf("%s ", iso_8601_time(ctl, rec, buf, sizeof(buf))); |