Lines Matching refs:pmptr

340 set_softcar(pmptr)
341 struct pmtab *pmptr;
353 if (*pmptr->p_softcar == '\0')
356 if (*pmptr->p_softcar == 'y')
359 if ((fd = open(pmptr->p_device, O_RDONLY|O_NONBLOCK|O_NOCTTY)) < 0) {
360 log("open (%s) failed: %s", pmptr->p_device, strerror(errno));
365 log("set soft-carrier (%s) failed: %s", pmptr->p_device,
373 * open_device(pmptr) - open the device
381 open_device(pmptr)
382 struct pmtab *pmptr;
391 if (pmptr->p_status == GETTY) {
392 revokedevaccess(pmptr->p_device, 0, 0, 0);
394 if ((fd = open(pmptr->p_device, O_RDWR)) == -1)
395 fatal("open (%s) failed: %s", pmptr->p_device,
399 if (check_spawnlimit(pmptr) == -1) {
400 pmptr->p_status = NOTVALID;
402 pmptr->p_tag);
405 if (pmptr->p_fd > 0) { /* file already open */
406 fd = pmptr->p_fd;
407 pmptr->p_fd = 0;
408 } else if ((fd = open(pmptr->p_device, O_RDWR|O_NONBLOCK))
410 log("open (%s) failed: %s", pmptr->p_device,
413 pmptr->p_status = UNACCESS;
431 pmptr->p_status = LOCKED;
444 if ((Initialized) && (pmptr->p_inservice != SESSION)) {
446 pmptr->p_device);
454 pmptr->p_status = SESSION;
455 pmptr->p_inservice = 0;
469 pmptr->p_inservice = 0;
472 if (pmptr->p_ttyflags & H_FLAG) {
480 if ((tmpfd = open(pmptr->p_device, O_RDWR|O_NONBLOCK)) == -1) {
481 log("open (%s) failed: %s", pmptr->p_device,
491 debug("open_device (%s), fd = %d", pmptr->p_device, fd);
497 if (pmptr->p_ttyflags & (B_FLAG|C_FLAG))
503 if ((pmptr->p_modules != NULL)&&(*(pmptr->p_modules) != '\0')) {
504 if (push_linedisc(fd, pmptr->p_modules, pmptr->p_device)
512 if (initial_termio(fd, pmptr) == -1) {
518 di_devperm_logout((const char *)pmptr->p_device);
519 pmptr->p_fd = fd;
551 check_spawnlimit(pmptr)
552 struct pmtab *pmptr;
557 if (pmptr->p_time == 0L)
558 pmptr->p_time = now;
559 if (pmptr->p_respawn >= SPAWN_LIMIT) {
560 if ((now - pmptr->p_time) < SPAWN_INTERVAL) {
561 pmptr->p_time = now;
562 pmptr->p_respawn = 0;
565 pmptr->p_time = now;
566 pmptr->p_respawn = 0;
568 pmptr->p_respawn++;