diff options
Diffstat (limited to 'sshpty.c')
-rw-r--r-- | sshpty.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshpty.c,v 1.30 2015/07/30 23:09:15 djm Exp $ */ | 1 | /* $OpenBSD: sshpty.c,v 1.31 2016/11/29 03:54:50 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -238,3 +238,17 @@ pty_setowner(struct passwd *pw, const char *tty) | |||
238 | } | 238 | } |
239 | } | 239 | } |
240 | } | 240 | } |
241 | |||
242 | /* Disconnect from the controlling tty. */ | ||
243 | void | ||
244 | disconnect_controlling_tty(void) | ||
245 | { | ||
246 | #ifdef TIOCNOTTY | ||
247 | int fd; | ||
248 | |||
249 | if ((fd = open(_PATH_TTY, O_RDWR | O_NOCTTY)) >= 0) { | ||
250 | (void) ioctl(fd, TIOCNOTTY, NULL); | ||
251 | close(fd); | ||
252 | } | ||
253 | #endif /* TIOCNOTTY */ | ||
254 | } | ||