Use strerror() for more usefull errormessages

This commit is contained in:
Axel Wagner
2011-01-01 16:48:30 +01:00
parent b40b921228
commit 497a091fbb
5 changed files with 15 additions and 12 deletions

View File

@ -59,7 +59,7 @@ void stdin_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) {
buffer[rec-1] = '\0';
break;
}
ELOG("read() failed!\n");
ELOG("read() failed!: %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
if (n == 0) {
@ -111,7 +111,7 @@ void start_child(char *command) {
child_pid = fork();
switch (child_pid) {
case -1:
ELOG("Couldn't fork()\n");
ELOG("Couldn't fork(): %s\n", strerror(errno));
exit(EXIT_FAILURE);
case 0:
/* Child-process. Reroute stdout and start shell */