Explorar o código

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

Krishnakumar, Sudha %!s(int64=6) %!d(string=hai) anos
pai
achega
b80606505f
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  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;
     }