diff options
author | 2011-03-11 12:02:39 +0000 | |
---|---|---|
committer | 2011-03-11 12:02:39 +0000 | |
commit | a8ec6d6442bdd6cbb318b207cf4ced4e8232b696 (patch) | |
tree | 0a7837963601fb6b6f8a2c10adee3543ddee31c6 | |
parent | 8f2189c7fde4aa134e954a1ff1040d09c826cfaf (diff) | |
download | paludis-a8ec6d6442bdd6cbb318b207cf4ced4e8232b696.tar.gz paludis-a8ec6d6442bdd6cbb318b207cf4ced4e8232b696.tar.xz |
Betterer error message
-rw-r--r-- | paludis/util/pipe.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/paludis/util/pipe.cc b/paludis/util/pipe.cc index fdb42f919..4538cf700 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() |