From: Costin Lupu Date: Mon, 2 Sep 2019 13:31:03 +0000 (+0300) Subject: Revisit pty.c functions X-Git-Tag: RELEASE-0.4~47 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b2a851d3f138e8ee2e0043bb543b8585024146d3;p=unikraft%2Flibs%2Fnewlib.git Revisit pty.c functions Actually the openpty() and forkpty() stubs should return errors, because otherwise the callee will try to use the amaster and aslave file descriptors returned by the functions. Signed-off-by: Costin Lupu Reviewed-by: Felipe Huici --- diff --git a/pty.c b/pty.c index 009688d..07346de 100644 --- a/pty.c +++ b/pty.c @@ -35,20 +35,23 @@ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY. */ -#include -#include #include +#include +#include +#include int openpty(int *amaster __unused, int *aslave __unused, char *name __unused, const struct termios *termp __unused, const struct winsize *winp __unused) { - return 0; + errno = ENOENT; + return -1; } pid_t forkpty(int *amaster __unused, char *name __unused, const struct termios *termp __unused, const struct winsize *winp __unused) { - return 0; + errno = ENOENT; + return -1; }