aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 95b46f4..a30f0f0 100644
--- a/src/util.c
+++ b/src/util.c
@@ -243,6 +243,11 @@ xenopen(int status, const char *path, int flags, int mode, ...)
return STDOUT_FILENO;
} else if (!strcmp(path, "/dev/stderr")) {
return STDERR_FILENO;
+ } else if (!strcmp(path, "-")) {
+ if ((flags & O_ACCMODE) == O_RDONLY)
+ return STDIN_FILENO;
+ else
+ return STDOUT_FILENO;
}
fd = open(path, flags, mode);
if (fd < 0)