diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-10 08:40:13 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-02-10 09:34:03 +1000 |
commit | ef179b7d9e8c5bb5defda131c6c1d84d8dc4e4a8 (patch) | |
tree | 2bd304e70b5f87579f16a91235f563dec2faaf01 | |
parent | 65f36426543c64129f723bf49f2434668fddbd6f (diff) |
Print device selection to stderr to separate from potential pipes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | evtest.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -440,7 +440,7 @@ static int scan_devices(void) if (ndev <= 0) return -1; - printf("Available devices:\n"); + fprintf(stderr, "Available devices:\n"); for (i = 0; i < ndev; i++) { @@ -455,12 +455,12 @@ static int scan_devices(void) continue; ioctl(fd, EVIOCGNAME(sizeof(name)), name); - printf("%s: %s\n", fname, name); + fprintf(stderr, "%s: %s\n", fname, name); close(fd); free(namelist[i]); } - printf("Select the device event number [0-%d]: ", ndev - 1); + fprintf(stderr, "Select the device event number [0-%d]: ", ndev - 1); scanf("%d", &devnum); if (devnum >= ndev || devnum < 0) @@ -482,11 +482,11 @@ static char* parse_args(int argc, char **argv) if (argc < 2) { int dev; - printf("No device specified, trying to scan all of %s/%s*\n", + fprintf(stderr, "No device specified, trying to scan all of %s/%s*\n", DEV_INPUT_EVENT, EVENT_DEV_NAME); if (getuid() != 0) - printf("Not running as root, no devices may be available.\n"); + fprintf(stderr, "Not running as root, no devices may be available.\n"); dev = scan_devices(); if (dev == -1) |