Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
st.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify control flow
[st.git]
/
std.c
diff --git
a/std.c
b/std.c
index
ef946dd
..
5368f67
100644
(file)
--- a/
std.c
+++ b/
std.c
@@
-109,11
+109,9
@@
getpty(void) {
ptm = posix_openpt(O_RDWR);
#else
ptm = open("/dev/ptmx", O_RDWR);
ptm = posix_openpt(O_RDWR);
#else
ptm = open("/dev/ptmx", O_RDWR);
- if(ptm == -1) {
+ if(ptm == -1)
if(openpty(&ptm, &pts, NULL, NULL, NULL) == -1)
eprintn("error, cannot open pty");
if(openpty(&ptm, &pts, NULL, NULL, NULL) == -1)
eprintn("error, cannot open pty");
- return;
- }
#endif
#if defined(_XOPEN_SOURCE)
if(ptm != -1) {
#endif
#if defined(_XOPEN_SOURCE)
if(ptm != -1) {
@@
-127,7
+125,6
@@
getpty(void) {
pts = open(ptsdev, O_RDWR);
if(pts == -1)
eprintn("error, cannot open slave pty");
pts = open(ptsdev, O_RDWR);
if(pts == -1)
eprintn("error, cannot open slave pty");
- puts(ptsdev);
}
else
eprintn("error, cannot open pty");
}
else
eprintn("error, cannot open pty");
@@
-319,8
+316,5
@@
main(int argc, char *argv[]) {
eprint("usage: st [-v]\n");
getpty();
shell();
eprint("usage: st [-v]\n");
getpty();
shell();
- fdopen(fptm, "r+");
- if(!fptm)
- eprintn("cannot open slave pty");
return 0;
}
return 0;
}