search for: endttyent

Displaying 3 results from an estimated 3 matches for "endttyent".

2005 Mar 30
1
utmp update for bsd systems
...- /* BSD implementor: may want to consider (or not) adjusting "lastlog" */ + int fd, topslot; + struct utmp ubuf; + + if ((fd = open(uname, O_RDWR, 0)) < 0) + return; + + if (!setttyent()) + return; + + for (topslot = 0; getttyent() != (struct ttyent *)NULL; ) + topslot++; + + if (!endttyent()) + return; + + (void) lseek(fd, (off_t)(topslot * sizeof(struct utmp)), SEEK_SET); + + DEBUG(1,("pututline(%s, %s, %d); topslot=%d\n", + u->ut_line, u->ut_name, claim, topslot)); + + while (1) { + if (read(fd, &ubuf, sizeof(ubuf)) == sizeof(ubuf)) { + if ((claim &&...
2005 Apr 14
1
utmp update for bsd systems (try 2)
...- /* BSD implementor: may want to consider (or not) adjusting "lastlog" */ + int fd, topslot; + struct utmp ubuf; + + if ((fd = open(uname, O_RDWR, 0)) < 0) + return; + + if (!setttyent()) + return; + + for (topslot = 0; getttyent() != (struct ttyent *)NULL; ) + topslot++; + + if (!endttyent()) + return; + + (void) lseek(fd, (off_t)(topslot * sizeof(struct utmp)), SEEK_SET); + + DEBUG(1,("pututline(%s, %s, %d); topslot=%d\n", + u->ut_line, u->ut_name, claim, topslot)); + + while (1) { + if (read(fd, &ubuf, sizeof(ubuf)) == sizeof(ubuf)) { + if ((claim &&...
2000 Aug 01
2
[2.1.1p4] utmp patch for SunOS 4.1.x
...TTTYENT) + + register struct ttyent *ty; + tty=0; + setttyent(); + while ((struct ttyent *)0 != (ty = getttyent())) { + tty++; + if(0 == strncmp(ty->ty_name,ut->ut_line,sizeof(ut->ut_line))) + break; + } + endttyent(); + if((struct ttyent *)0 == ty) { + log("utmp_write_entry: tty not found"); + return(1); + } + + #else /* FIXME */ + tty = ttyslot(); /* seems only to work for /dev/ttyp? style names */ + #endif /* SUNOS4 && HAVE_GETTTYENT */ + i...