aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-11 12:02:39 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-11 12:02:39 +0000
commita8ec6d6442bdd6cbb318b207cf4ced4e8232b696 (patch)
tree0a7837963601fb6b6f8a2c10adee3543ddee31c6
parent8f2189c7fde4aa134e954a1ff1040d09c826cfaf (diff)
downloadpaludis-a8ec6d6442bdd6cbb318b207cf4ced4e8232b696.tar.gz
paludis-a8ec6d6442bdd6cbb318b207cf4ced4e8232b696.tar.xz
Betterer error message
-rw-r--r--paludis/util/pipe.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/paludis/util/pipe.cc b/paludis/util/pipe.cc
index fdb42f9..4538cf7 100644
--- a/paludis/util/pipe.cc
+++ b/paludis/util/pipe.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2009 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -21,8 +21,10 @@
#include "pipe.hh"
#include <paludis/util/exception.hh>
#include <paludis/util/log.hh>
+#include <cstring>
#include <unistd.h>
#include <fcntl.h>
+#include <errno.h>
using namespace paludis;
@@ -42,7 +44,12 @@ Pipe::Pipe(const bool close_exec)
/* if your os doesn't have pipe2, you'll need to make this use a big nasty
* global mutex along with everything that calls fork(). */
if (-1 == pipe2(_fds, close_exec ? O_CLOEXEC : 0))
- throw InternalError(PALUDIS_HERE, "pipe(2) failed");
+ {
+ if (errno == ENOSYS)
+ throw InternalError(PALUDIS_HERE, "pipe(2) failed with ENOSYS. Is your kernel older than your linux-headers?");
+ else
+ throw InternalError(PALUDIS_HERE, "pipe(2) failed with " + stringify(strerror(errno)));
+ }
}
Pipe::~Pipe()