summaryrefslogtreecommitdiffstats
path: root/sys-utils/rfkill.c
diff options
context:
space:
mode:
authorJ William Piggott2017-10-15 02:37:11 +0200
committerJ William Piggott2017-11-10 22:34:55 +0100
commit4111bb3ab5f406ee381a3807385af59fe33b28f3 (patch)
treed03f85ab061bfade57c03c716e5226048fcdc8af /sys-utils/rfkill.c
parentlib/timeutils: add get_gmtoff() (diff)
downloadkernel-qcow2-util-linux-4111bb3ab5f406ee381a3807385af59fe33b28f3.tar.gz
kernel-qcow2-util-linux-4111bb3ab5f406ee381a3807385af59fe33b28f3.tar.xz
kernel-qcow2-util-linux-4111bb3ab5f406ee381a3807385af59fe33b28f3.zip
lib/timeutils: add common ISO timestamp masks
* Start the ISO format flags at bit 0 instead of bit 1. * Remove unnecessary _8601 from ISO format flag names to avoid line wrapping and to ease readability. * ISO timestamps have date-time-timzone in common, so move the TIMEZONE flag to bit 2 causing all timestamp masks to have the first three bits set and the last four bits as timestamp 'options'. * Change the 'SPACE' flag to a 'T' flag, because it makes the code and comments more concise. * Add common ISO timestamp masks. * Implement the ISO timestamp masks in all applicable code using the strxxx_iso() functions. Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'sys-utils/rfkill.c')
-rw-r--r--sys-utils/rfkill.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c
index c9559ef48..75804ad41 100644
--- a/sys-utils/rfkill.c
+++ b/sys-utils/rfkill.c
@@ -223,7 +223,7 @@ static int rfkill_event(void)
{
struct rfkill_event event;
struct timeval tv;
- char date_buf[ISO_8601_BUFSIZ];
+ char date_buf[ISO_BUFSIZ];
struct pollfd p;
int fd, n;
@@ -253,12 +253,8 @@ static int rfkill_event(void)
continue;
gettimeofday(&tv, NULL);
- strtimeval_iso(&tv,
- ISO_8601_DATE |
- ISO_8601_TIME |
- ISO_8601_COMMAUSEC |
- ISO_8601_TIMEZONE |
- ISO_8601_SPACE, date_buf, sizeof(date_buf));
+ strtimeval_iso(&tv, ISO_TIMESTAMP_COMMA, date_buf,
+ sizeof(date_buf));
printf("%s: idx %u type %u op %u soft %u hard %u\n",
date_buf,
event.idx, event.type, event.op, event.soft, event.hard);