[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/NEWLIB PATCH 2/2] Revisit pty.c functions


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Mon, 2 Sep 2019 16:31:03 +0300
  • Cc: felipe.huici@xxxxxxxxx, simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx
  • Delivery-date: Mon, 02 Sep 2019 13:31:17 +0000
  • Ironport-phdr: 9a23:wh0DDBKeyJzee1xlhdmcpTZWNBhigK39O0sv0rFitYgfLvrxwZ3uMQTl6Ol3ixeRBMOHsqgC0rWO+P67EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCejbb9oMRm7rxndusYXjIZsN6081gbHrnxUdupM2GhmP0iTnxHy5sex+J5s7SFdsO8/+sBDTKv3Yb02QaRXAzo6PW814tbrtQTYQguU+nQcSGQWnQFWDAXD8Rr3Q43+sir+tup6xSmaIcj7Rq06VDi+86tmTgLjhSEaPDA77W7XkNR9gqJFrhy8qRJxwInab4ObNPdlYq/RYckXSXZbU8pNSyBMBJ63YYsVD+oGOOZVt5fwp1wVrRuiBAmsAv7kxDlVhn/uwK0xzuMsHh3B3Aw7A9IOsXLUoM/xNKcPSeC10bLFwinYb/9MwTf99ZPHfgo7ofGLRL99d9fax0o3Fw7dk1mdppHpMymW2+kNqWSX8fRsWOC1h2Mpsw19vzeiyto2hoTKho8Z0E7I+Ct3zYovONG1R1B3bNi5G5VKrS6aLZF5QsY6TmFtvyY116MJtIagfCgP1JQn3xnfa+Gbc4SQ4hLsSuKRITBgiXJ7fbKwnRey8Uy6xuLgTcm4yk5KrjdendXWrHAN0ATf6smBSvRj4keswSuD2g/O5u1eIk05lbDXJ4A/zrMyjJYev1zPHirsl0X3iK+WeF8k+u+t6+n/frrmoYScN5N1igH4KKguntG/AfwlMgUVQ2eb4v6w1KX+/ULiWrlKlPo2nrHDsJ/GPcQburK5AwhN34Ym6ha/CTam0NMDnXUeMV1KZgyHgJbtO1zVJPD4DOy/g0i3kDtxyPHJILvhDo/KLnjZn7frZax95FJEyAov0dBf4IpZCr8fL/L3W0/xrMLXAgU5MwypwuboFNR925gYWW2RHqCZNLndvkSS6u0xPumGfJUVtyrlK/g5+/7uimc0mUQdfaazx5sYcna4Eu59I0qDZ3rsntcBHn0MvgUkSeznk1uCXiBPaHa2Ra0z/Ss3B5y7DY3bXICinKSB3DunHp1Rfm1GEVGMEXLvd4WCQfsMaz+SLdFnkj0FS7ehUZQs1RewuwDmz7poNPHb9jcGupL+h5BJ4LjWlBcz8icxA8mD3mWlS2BvgnhOVzIwmqdlrh9T0FCGhIN/mOBZE5R3+utUGlMxMoXAzuo8D83qRyrKZZGRVVzgWNLwUmJ5dc4439JbOxU1IN6llB2Whyc=
  • Ironport-sdr: tCSmcLUtkJujdpOhjdfL4a7wdhfFw+HPbvMG1VLHGu9IIVVEFim42kzfHF3PvSl826O1zFvD4k z/mpezJkapxw==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.