summaryrefslogtreecommitdiffstats
path: root/lib/Utils/xfuncs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Utils/xfuncs.cpp')
-rw-r--r--lib/Utils/xfuncs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Utils/xfuncs.cpp b/lib/Utils/xfuncs.cpp
index 078c804..60c2eb4 100644
--- a/lib/Utils/xfuncs.cpp
+++ b/lib/Utils/xfuncs.cpp
@@ -88,6 +88,12 @@ void xpipe(int filedes[2])
perror_msg_and_die("can't create pipe");
}
+void xdup(int from)
+{
+ if (dup(from) < 0)
+ perror_msg_and_die("can't duplicate file descriptor");
+}
+
void xdup2(int from, int to)
{
if (dup2(from, to) != to)