summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-02-25 10:41:50 +1000
committerBenjamin Tissoires <benjamin.tissoires@gmail.com>2016-02-25 10:01:05 +0100
commit152f562f0d6f7438fe6471ff4c69cd9250548ff1 (patch)
tree9dcc4528994ddfb928d0a3289a4b436e1ce3a3cb
parent7f89dd9ffa2d0a0aeea1022d5d3182995d834130 (diff)
tools: append strerror to the error messages
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
-rw-r--r--tools/evemu-device.c2
-rw-r--r--tools/evemu-event.c2
-rw-r--r--tools/evemu-play.c2
-rw-r--r--tools/evemu-record.c8
4 files changed, 7 insertions, 7 deletions
diff --git a/tools/evemu-device.c b/tools/evemu-device.c
index 66047f2..925e5d5 100644
--- a/tools/evemu-device.c
+++ b/tools/evemu-device.c
@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
}
fp = fopen(argv[1], "r");
if (!fp) {
- fprintf(stderr, "error: could not open file\n");
+ fprintf(stderr, "error: could not open file (%m)\n");
return -1;
}
ret = evemu_device(fp);
diff --git a/tools/evemu-event.c b/tools/evemu-event.c
index 0ee4c8e..ce928ac 100644
--- a/tools/evemu-event.c
+++ b/tools/evemu-event.c
@@ -152,7 +152,7 @@ int main(int argc, char *argv[])
fd = open(path, O_WRONLY);
if (fd < 0) {
- fprintf(stderr, "error: could not open device\n");
+ fprintf(stderr, "error: could not open device (%m)\n");
goto out;
}
diff --git a/tools/evemu-play.c b/tools/evemu-play.c
index d819567..84aa668 100644
--- a/tools/evemu-play.c
+++ b/tools/evemu-play.c
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
}
fd = open(argv[1], O_WRONLY);
if (fd < 0) {
- fprintf(stderr, "error: could not open device\n");
+ fprintf(stderr, "error: could not open device (%m)\n");
return -1;
}
if (evemu_play(stdin, fd)) {
diff --git a/tools/evemu-record.c b/tools/evemu-record.c
index 305bfe5..eedf4fa 100644
--- a/tools/evemu-record.c
+++ b/tools/evemu-record.c
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
}
fd = open(device, O_RDONLY | O_NONBLOCK);
if (fd < 0) {
- fprintf(stderr, "error: could not open device\n");
+ fprintf(stderr, "error: could not open device (%m)\n");
return -1;
}
@@ -116,11 +116,11 @@ int main(int argc, char *argv[])
act.sa_handler = &handler;
if (sigaction(SIGTERM, &act, NULL) < 0) {
- fprintf (stderr, "Could not attach TERM signal handler.\n");
+ fprintf (stderr, "Could not attach TERM signal handler (%m)\n");
return 1;
}
if (sigaction(SIGINT, &act, NULL) < 0) {
- fprintf (stderr, "Could not attach INT signal handler.\n");
+ fprintf (stderr, "Could not attach INT signal handler (%m)\n");
return 1;
}
@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
else {
output = fopen(argv[2], "w");
if (!output) {
- fprintf(stderr, "error: could not open output file");
+ fprintf(stderr, "error: could not open output file (%m)");
}
}