Date: Sun, 26 Oct 2008 21:55:19 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/lib/libc/stdlib grantpt.3 grantpt.c src/lib/libutil pty.c Message-ID: <200810262155.m9QLtpgO061451@repoman.freebsd.org>
index | next in thread | raw e-mail
ed 2008-10-26 21:55:19 UTC
FreeBSD src repository
Modified files: (Branch: RELENG_7)
lib/libc/stdlib grantpt.3 grantpt.c
lib/libutil pty.c
Log:
SVN rev 184300 on 2008-10-26 21:55:19Z by ed
MFC r183565:
Small cleanups to openpty().
- Pass O_NOCTTY to posix_openpt(2). This makes the implementation work
consistently on implementations that make the PTY the controlling TTY
by default.
- Call unlockpt() before opening the slave device. POSIX mentions that
de slave device should only be opened after grantpt() and unlockpt()
have been called.
- Replace some redundant code by a label.
As a safety net, add a call to revoke() to unlockpt(). All applications
out there use openpty(), explicitly call revoke() or implement their own
PTY allocation routines. Adding the call to unlockpt() won't hurt, but
will prevent foot-shooting.
Reviewed by: jhb, kib
Approved by: re
Revision Changes Path
1.3.20.1 +0 -5 src/lib/libc/stdlib/grantpt.3
1.7.2.6 +10 -4 src/lib/libc/stdlib/grantpt.c
1.17.2.4 +15 -23 src/lib/libutil/pty.c
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810262155.m9QLtpgO061451>
