Fix test of fcntl's return value.
[pspp] / lib / pipe-filter-gi.c
index 886820a414edcd7b088a56b11aa1254109952266..340b38af0c42292cf4b3f8cf50e3be761a7d9ecd 100644 (file)
@@ -248,9 +248,9 @@ filter_init (struct pipe_filter_gi *filter)
     int fcntl_flags;
 
     if ((fcntl_flags = fcntl (filter->fd[1], F_GETFL, 0)) < 0
-       || fcntl (filter->fd[1], F_SETFL, fcntl_flags | O_NONBLOCK) < 0
+       || fcntl (filter->fd[1], F_SETFL, fcntl_flags | O_NONBLOCK) == -1
        || (fcntl_flags = fcntl (filter->fd[0], F_GETFL, 0)) < 0
-       || fcntl (filter->fd[0], F_SETFL, fcntl_flags | O_NONBLOCK) < 0)
+       || fcntl (filter->fd[0], F_SETFL, fcntl_flags | O_NONBLOCK) == -1)
       {
        if (filter->exit_on_error)
          error (EXIT_FAILURE, errno,