From c4cea3e5c71c8f2d48ee22ea05d26a47fb47ad29 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 2 Mar 2000 23:31:50 +1100 Subject: [PATCH] - Avoid warning message with Unix98 ptys --- ChangeLog | 1 + pty.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12edfc444..4d3e87fbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ to detect library and header location _and_ ensure library has proper RSA support built in (this is a problem with OpenSSL 0.9.5). - Applied pty cleanup patch from markus.friedl@informatik.uni-erlangen.de + - Avoid warning message with Unix98 ptys 20000207 - Removed SOCKS code. Will support through a ProxyCommand. diff --git a/pty.c b/pty.c index de6f751d8..27e0fe9e9 100644 --- a/pty.c +++ b/pty.c @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$Id: pty.c,v 1.12 2000/03/02 12:30:53 damien Exp $"); +RCSID("$Id: pty.c,v 1.13 2000/03/02 12:31:50 damien Exp $"); #ifdef HAVE_UTIL_H # include @@ -187,9 +187,9 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) void pty_release(const char *ttyname) { - if (chown(ttyname, (uid_t) 0, (gid_t) 0) < 0) + if ((chown(ttyname, (uid_t) 0, (gid_t) 0) < 0) && (errno != ENOENT)) error("chown %.100s 0 0 failed: %.100s", ttyname, strerror(errno)); - if (chmod(ttyname, (mode_t) 0666) < 0) + if ((chmod(ttyname, (mode_t) 0666) < 0) && (errno != ENOENT)) error("chmod %.100s 0666 failed: %.100s", ttyname, strerror(errno)); }