summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2ae980f)
raw | patch | inline | side by side (parent: 2ae980f)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 1 Jun 2010 12:40:31 +0000 (08:40 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 1 Jun 2010 13:02:06 +0000 (09:02 -0400) |
tig.c | patch | blob | history |
index 46f289ec1335debbcff6bc0ba014455bf7d06c77..a9924c91a7192d6745440f17124e044d4dda6017 100644 (file)
--- a/tig.c
+++ b/tig.c
return io_start(io);
}
-static int
-io_complete(struct io *io)
+static bool
+io_complete(enum io_type type, const char **argv, const char *dir, int fd)
{
- return io_start(io) && io_done(io);
+ struct io io = {};
+
+ io_prepare(&io, dir, type, argv);
+ io.pipe = fd;
+ return io_start(&io) && io_done(&io);
}
-static int
+static bool
io_run_bg(const char **argv)
{
- struct io io = {};
-
- io_prepare(&io, NULL, IO_BG, argv);
- return io_complete(&io);
+ return io_complete(IO_BG, argv, NULL, -1);
}
static bool
io_run_fg(const char **argv, const char *dir)
{
- struct io io = {};
-
- io_prepare(&io, dir, IO_FG, argv);
- return io_complete(&io);
+ return io_complete(IO_FG, argv, dir, -1);
}
static bool
io_run_append(const char **argv, int fd)
{
- struct io io = {};
-
- io_prepare(&io, NULL, IO_AP, argv);
- io.pipe = fd;
- return io_complete(&io);
+ return io_complete(IO_AP, argv, NULL, -1);
}
static bool