Alexandre Julliard : server: Set a proper error code when dup_fd_object fails.

Alexandre Julliard julliard at winehq.org
Thu Apr 1 11:25:06 CDT 2010


Module: wine
Branch: master
Commit: 7d1d002d4c547570e0835a9c5714363b58203490
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7d1d002d4c547570e0835a9c5714363b58203490

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Apr  1 15:40:23 2010 +0200

server: Set a proper error code when dup_fd_object fails.

---

 server/fd.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/server/fd.c b/server/fd.c
index e26ce04..ca317c4 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1628,6 +1628,7 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
         if (!closed) goto failed;
         if ((fd->unix_fd = dup( orig->unix_fd )) == -1)
         {
+            file_set_error();
             free( closed );
             goto failed;
         }
@@ -1637,8 +1638,11 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
         fd->inode = (struct inode *)grab_object( orig->inode );
         list_add_head( &fd->inode->open, &fd->inode_entry );
     }
-    else if ((fd->unix_fd = dup( orig->unix_fd )) == -1) goto failed;
-
+    else if ((fd->unix_fd = dup( orig->unix_fd )) == -1)
+    {
+        file_set_error();
+        goto failed;
+    }
     return fd;
 
 failed:




More information about the wine-cvs mailing list