summaryrefslogtreecommitdiffstats
path: root/pty.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-03-02 23:31:50 +1100
committerDamien Miller <djm@mindrot.org>2000-03-02 23:31:50 +1100
commitc4cea3e5c71c8f2d48ee22ea05d26a47fb47ad29 (patch)
treec16a3f258f67064d05b6c46677792353d6258b68 /pty.c
parentc7d8dbbb0dfdeb3f854d58c9bf084db2b72ded77 (diff)
- Avoid warning message with Unix98 ptys
Diffstat (limited to 'pty.c')
-rw-r--r--pty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pty.c b/pty.c
index de6f751d..27e0fe9e 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 <util.h>
@@ -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));
}