summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-11-15 20:13:44 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-11-15 20:13:44 +0100
commitc7d311d6b9bbe4989a4f1b9eeea8765ae669fadd (patch)
tree29fbf9a9a9f3c60b80c2219dbcfc44188c49d497
parent9b5b8e03c99335b1e4a2bc37cf0197e453728784 (diff)
downloadpjctl-c7d311d6b9bbe4989a4f1b9eeea8765ae669fadd.tar.gz
pjctl-c7d311d6b9bbe4989a4f1b9eeea8765ae669fadd.tar.bz2
pjctl-c7d311d6b9bbe4989a4f1b9eeea8765ae669fadd.zip
Use strerror instead of printf gnu extension %m
-rw-r--r--src/pjctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pjctl.c b/src/pjctl.c
index 08854bd..3570466 100644
--- a/src/pjctl.c
+++ b/src/pjctl.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
+#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -175,7 +176,7 @@ send_next_cmd(struct pjctl *pjctl)
msg.msg_iovlen++;
if (sendmsg(pjctl->fd, &msg, 0) < 0) {
- fprintf(stderr, "sendmsg failed: %m\n");
+ fprintf(stderr, "sendmsg failed: %s\n", strerror(errno));
return -1;
}
@@ -768,7 +769,7 @@ main(int argc, char **argv)
}
freeaddrinfo(result);
if (rp == NULL) {
- fprintf(stderr, "Failed to connect: %m\n");
+ fprintf(stderr, "Failed to connect: %s\n", strerror(errno));
return 1;
}