summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2464a77)
raw | patch | inline | side by side (parent: 2464a77)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sat, 27 Mar 2010 15:35:10 +0000 (11:35 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 29 Mar 2010 00:18:17 +0000 (20:18 -0400) |
tig.c | patch | blob | history |
index 6e9bb3083345b3bda19ba78f2bae83330ce3f4ed..ccd810d85d8c64bc9e500cef647351d63ba23ca4 100644 (file)
--- a/tig.c
+++ b/tig.c
if (waiting < 0) {
if (errno == EINTR)
continue;
- report("waitpid failed (%s)", strerror(errno));
+ io->error = errno;
return FALSE;
}
if (io->type == IO_FD)
return TRUE;
- if ((io->type == IO_RD || io->type == IO_WR) &&
- pipe(pipefds) < 0)
+ if ((io->type == IO_RD || io->type == IO_WR) && pipe(pipefds) < 0) {
+ io->error = errno;
return FALSE;
- else if (io->type == IO_AP)
+ } else if (io->type == IO_AP) {
pipefds[1] = io->pipe;
+ }
if ((io->pid = fork())) {
+ if (io->pid == -1)
+ io->error = errno;
if (pipefds[!(io->type == IO_WR)] != -1)
close(pipefds[!(io->type == IO_WR)]);
if (io->pid != -1) {
}
if (io->dir && *io->dir && chdir(io->dir) == -1)
- die("Failed to change directory: %s", strerror(errno));
+ exit(errno);
execvp(io->argv[0], (char *const*) io->argv);
- die("Failed to execute program: %s", strerror(errno));
+ exit(errno);
}
if (pipefds[!!(io->type == IO_WR)] != -1)