]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
save errno before closing fds in error path and restore
authorRay Strode <rstrode@redhat.com>
Wed, 30 May 2007 00:46:07 +0000 (20:46 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 30 May 2007 00:46:07 +0000 (20:46 -0400)
afterward.

src/ply-utils.c

index cdff0efa8b6e4eefc7d58914d63d4218470902b9..0343bf3b19f24b94d2ce7ca54199bef836af583c 100644 (file)
@@ -60,15 +60,19 @@ ply_open_unidirectional_pipe (int *sender_fd,
 
   if (fcntl (pipe_fds[0], F_SETFD, O_NONBLOCK | FD_CLOEXEC) < 0)
     {
+      ply_save_errno ();
       close (pipe_fds[0]);
       close (pipe_fds[1]);
+      ply_restore_errno ();
       return false;
     }
 
   if (fcntl (pipe_fds[1], F_SETFD, O_NONBLOCK | FD_CLOEXEC) < 0)
     {
+      ply_save_errno ();
       close (pipe_fds[0]);
       close (pipe_fds[1]);
+      ply_restore_errno ();
       return false;
     }