|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT/NEWLIB PATCH 2/2] Revisit pty.c functions
Hi Costin, this patch looks good.
Reviewed-by: Felipe Huici <felipe.huici@xxxxxxxxx>
On 02.09.19, 15:31, "Costin Lupu" <costin.lupu@xxxxxxxxx> wrote:
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 <costin.lupu@xxxxxxxxx>
---
pty.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
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 <pty.h>
-#include <sys/types.h>
#include <uk/essentials.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <pty.h>
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;
}
--
2.20.1
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |