#include "optutils.h"
#include "pathnames.h"
#include "strutils.h"
+#include "timeutils.h"
#include "widechar.h"
#include "xalloc.h"
{
struct rfkill_event event;
struct timeval tv;
+ char date_buf[ISO_8601_BUFSIZ];
struct pollfd p;
ssize_t len;
int fd, n, ret = 0;
ret = 1;
continue;
}
-
gettimeofday(&tv, NULL);
- printf("%ld.%06u: idx %u type %u op %u soft %u hard %u\n",
- (long) tv.tv_sec, (unsigned int) tv.tv_usec,
- event.idx, event.type, event.op, event.soft, event.hard);
+ strtimeval_iso(&tv,
+ ISO_8601_DATE |
+ ISO_8601_TIME |
+ ISO_8601_COMMAUSEC |
+ ISO_8601_TIMEZONE |
+ ISO_8601_SPACE, 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);
fflush(stdout);
}