Lines Matching defs:tty
125 char *ep, *tty;
134 tty = NULL;
193 case 't': /* Slave TTY name */
195 asprintf(&tty, "%s%s", _PATH_DEV, optarg);
197 tty = optarg;
218 if (tty == NULL) {
222 tty_in = open_tty(tty);
237 if (tty == NULL) {
264 syslog(LOG_INFO, "Starting on %s...", (tty ? tty : "stdio"));
285 syslog(LOG_INFO, "Completed on %s", (tty ? tty : "stdio"));
290 open_tty(const char *tty)
298 * Construct master PTY name. The slave tty name must be less than
302 if (strlcpy(pty, tty, sizeof(pty)) >= sizeof(pty))
303 errx(EXIT_FAILURE, "Tty name too long `%s'", tty);
307 errx(EXIT_FAILURE, "Invalid tty `%s'", tty);
310 if (strcmp(pty, tty) == 0)
311 errx(EXIT_FAILURE, "Master and slave tty are the same (%s)",
312 tty);
318 * Slave TTY
320 if ((gr = getgrnam("tty")) != NULL)
325 if (chown(tty, getuid(), ttygid) == -1)
327 if (chmod(tty, S_IRUSR | S_IWUSR | S_IWGRP) == -1)
329 if (revoke(tty) == -1)
696 " [-t tty]\n"
706 "\t-t tty run in background using pty\n"