summaryrefslogtreecommitdiffstats
path: root/rfkill.c
diff options
context:
space:
mode:
authorJohannes Berg2009-12-03 14:28:03 +0100
committerJohannes Berg2009-12-03 14:28:03 +0100
commit6217bea39d56404cebf09fe0084f867758d781ba (patch)
treeac675a8e58f0d02757714cc32374cacf2537b0ab /rfkill.c
parentflush output after events (diff)
downloadkernel-qcow2-util-linux-6217bea39d56404cebf09fe0084f867758d781ba.tar.gz
kernel-qcow2-util-linux-6217bea39d56404cebf09fe0084f867758d781ba.tar.xz
kernel-qcow2-util-linux-6217bea39d56404cebf09fe0084f867758d781ba.zip
print time instead of useless text
Diffstat (limited to 'rfkill.c')
-rw-r--r--rfkill.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/rfkill.c b/rfkill.c
index 21a015857..216e6ac2a 100644
--- a/rfkill.c
+++ b/rfkill.c
@@ -12,6 +12,7 @@
#include <stdbool.h>
#include <sys/types.h>
#include <sys/poll.h>
+#include <sys/time.h>
#include "rfkill.h"
#include "core.h"
@@ -19,6 +20,7 @@
static void rfkill_event(void)
{
struct rfkill_event event;
+ struct timeval tv;
struct pollfd p;
ssize_t len;
int fd, n;
@@ -54,9 +56,10 @@ static void rfkill_event(void)
continue;
}
- printf("RFKILL event: idx %u type %u op %u soft %u hard %u\n",
- event.idx, event.type, event.op,
- event.soft, event.hard);
+ 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);
fflush(stdout);
}