Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
correct programme name
[st.git]
/
pty.c
diff --git
a/pty.c
b/pty.c
index
bf0b0f7
..
3efaa7f
100644
(file)
--- a/
pty.c
+++ b/
pty.c
@@
-21,22
+21,22
@@
getpty(void) {
ptm = open("/dev/ptmx", O_RDWR);
if(ptm == -1)
if(openpty(&ptm, &pts, NULL, NULL, NULL) == -1)
ptm = open("/dev/ptmx", O_RDWR);
if(ptm == -1)
if(openpty(&ptm, &pts, NULL, NULL, NULL) == -1)
- e
printn("error,
cannot open pty");
+ e
rr(EXIT_FAILURE, "
cannot open pty");
#endif
#if defined(_XOPEN_SOURCE)
if(ptm != -1) {
if(grantpt(ptm) == -1)
#endif
#if defined(_XOPEN_SOURCE)
if(ptm != -1) {
if(grantpt(ptm) == -1)
- e
printn("error,
cannot grant access to pty");
+ e
rr(EXIT_FAILURE, "
cannot grant access to pty");
if(unlockpt(ptm) == -1)
if(unlockpt(ptm) == -1)
- e
printn("error,
cannot unlock pty");
+ e
rr(EXIT_FAILURE, "
cannot unlock pty");
ptsdev = ptsname(ptm);
if(!ptsdev)
ptsdev = ptsname(ptm);
if(!ptsdev)
- e
printn("error,
slave pty name undefined");
+ e
rr(EXIT_FAILURE, "
slave pty name undefined");
pts = open(ptsdev, O_RDWR);
if(pts == -1)
pts = open(ptsdev, O_RDWR);
if(pts == -1)
- e
printn("error,
cannot open slave pty");
+ e
rr(EXIT_FAILURE, "
cannot open slave pty");
}
else
}
else
- e
printn("error,
cannot open pty");
+ e
rr(EXIT_FAILURE, "
cannot open pty");
#endif
}
#endif
}