Get rid of E_SIGNAL_PIPE.
[paraslash.git] / signal.c
index bf0cd5ccff28286852858e1b4f22bf00f9436f7b..1db008ca89a92a23f3c08017a74be04e3e06f1d5 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -16,7 +16,7 @@
 static int signal_pipe[2];
 
 /**
- * initialize the paraslash signal subsystem
+ * Initialize the paraslash signal subsystem.
  *
  * This function creates a pipe, the signal pipe, to deliver pending
  * signals to the application (Bernstein's trick). It should be called
@@ -35,9 +35,11 @@ static int signal_pipe[2];
  */
 int para_signal_init(void)
 {
-       int ret = -E_SIGNAL_PIPE;
-       if (pipe(signal_pipe))
+       int ret;
+       if (pipe(signal_pipe) < 0) {
+               ret = -ERRNO_TO_PARA_ERROR(errno);
                goto err_out;
+       }
        ret = mark_fd_nonblock(signal_pipe[0]);
        if (ret < 0)
                goto err_out;
@@ -122,7 +124,7 @@ int para_install_sighandler(int sig)
  * This should be called if the fd for the signal pipe is ready for reading.
  *
  * \return On success, the number of the received signal is returned. \p
- * -E_SIGNAL_READ is returned if a read error occured while reading the signal
+ * -E_SIGNAL_READ is returned if a read error occurred while reading the signal
  * pipe.  If the read was interrupted by another signal the function returns 0.
  */
 int para_next_signal(void)