projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch from Brad Smith to use posix_openpt() instead of
[u/mdw/putty]
/
unix
/
uxpty.c
diff --git
a/unix/uxpty.c
b/unix/uxpty.c
index
99c1221
..
186ff5a
100644
(file)
--- a/
unix/uxpty.c
+++ b/
unix/uxpty.c
@@
-342,12
+342,21
@@
static void pty_open_master(Pty pty)
#endif
;
#endif
;
+#ifdef HAVE_POSIX_OPENPT
+ pty->master_fd = posix_openpt(flags);
+
+ if (pty->master_fd < 0) {
+ perror("posix_openpt");
+ exit(1);
+ }
+#else
pty->master_fd = open("/dev/ptmx", flags);
if (pty->master_fd < 0) {
perror("/dev/ptmx: open");
exit(1);
}
pty->master_fd = open("/dev/ptmx", flags);
if (pty->master_fd < 0) {
perror("/dev/ptmx: open");
exit(1);
}
+#endif
if (grantpt(pty->master_fd) < 0) {
perror("grantpt");
if (grantpt(pty->master_fd) < 0) {
perror("grantpt");