]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
Revisit the pipe function
authorVlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@stud.acs.upb.ro>
Wed, 4 Sep 2019 15:47:25 +0000 (15:47 +0000)
committerCostin Lupu <costin.lupu@cs.pub.ro>
Wed, 4 Sep 2019 16:48:49 +0000 (19:48 +0300)
The pipe(...) stub should return an error. This is becuase the callee
will try to use the file descriptors returned by this function.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Costin Lupu <costin.lupu@cs.pub.ro>
file.c

diff --git a/file.c b/file.c
index 156667920151c487528a446cd6e3039afceb2858..7d78f798947e00ede584fe46c63a14a86dd1e056 100644 (file)
--- a/file.c
+++ b/file.c
@@ -116,7 +116,8 @@ int utimes(const char *filename __unused,
 
 int pipe(int pipefd[2] __unused)
 {
-       return 0;
+       errno = EFAULT;
+       return -1;
 }
 
 char *realpath(const char *restrict file_name, char *restrict resolved_name)