Browse Source

[LibOS] Propagate error code on failures in shim_do_pipe2()/shim_do_socketpair()

Krishnakumar, Sudha 4 years ago
parent
commit
b80606505f
1 changed files with 2 additions and 0 deletions
  1. 2 0
      LibOS/shim/src/sys/shim_pipe.c

+ 2 - 0
LibOS/shim/src/sys/shim_pipe.c

@@ -114,6 +114,7 @@ int shim_do_pipe2(int* filedes, int flags) {
             if (tmp)
                 put_handle(tmp);
         }
+        ret = (vfd1 < 0) ? vfd1 : vfd2;
         goto out;
     }
 
@@ -193,6 +194,7 @@ int shim_do_socketpair(int domain, int type, int protocol, int* sv) {
             if (tmp)
                 put_handle(tmp);
         }
+        ret = (vfd1 < 0) ? vfd1 : vfd2;
         goto out;
     }