Lines Matching defs:bp

125 	struct utmpx *bp;
255 bp = &buf[read(wtmp, buf, sizeof (buf)) / sizeof (buf[0]) - 1];
256 for (; bp >= buf; bp--) {
257 if (want(bp, &ut_host, &ut_user)) {
266 * If bp->ut_line is longer than LMAX,
271 (void) strlcpy(ttnames[i], bp->ut_line,
278 i, bp);
281 bp->ut_line, ut_host, ut_user)) {
283 &print, i, bp);
289 if (strncmp(bp->ut_line, "ftp", 3) == 0)
290 bp->ut_line[3] = '\0';
291 if (strncmp(bp->ut_line, "uucp", 4) == 0)
292 bp->ut_line[4] = '\0';
294 ct = ctime(&bp->ut_xtime);
296 LOGIN_WIDTH, NMAX, bp->ut_name,
297 LINE_WIDTH, LMAX, bp->ut_line);
298 hostf_len = strlen(bp->ut_host);
301 bp->ut_host);
305 if (!lineq(bp->ut_line, "system boot") &&
306 !lineq(bp->ut_line, "system down")) {
308 bp->ut_type == USER_PROCESS) {
351 delta = otime - bp->ut_xtime;
385 if (bp->ut_type == BOOT_TIME) {
387 logouts[i] = -bp->ut_xtime;
388 bootxtime = -bp->ut_xtime;
458 want(struct utmpx *bp, char **host, char **user)
467 if (strncmp(bp->ut_line, "dtremote", 8) == 0) {
468 *host = bp->ut_host;
469 *user = bp->ut_user;
472 else if (strncmp(bp->ut_line, "dtlocal", 7) == 0) {
473 *host = bp->ut_host;
474 *user = bp->ut_user;
481 if ((bp->ut_type == BOOT_TIME) || (bp->ut_type == DOWN_TIME))
482 (void) strcpy(bp->ut_user, "reboot");
484 if (bp->ut_type != USER_PROCESS && bp->ut_type != DEAD_PROCESS &&
485 bp->ut_type != BOOT_TIME && bp->ut_type != DOWN_TIME)
488 if (bp->ut_user[0] == '.')
492 if (bp->ut_line[0] != '\0')
497 if (nameq(*name, bp->ut_name) ||
498 lineq(*name, bp->ut_line) ||
500 (strncmp(bp->ut_line, "ftp", 3) == 0))) {
525 record_time(time_t *otime, int *print, int i, struct utmpx *bp)
528 logouts[i] = bp->ut_xtime;
529 if ((bp->ut_type == USER_PROCESS && bp->ut_user[0] != '\0') ||
530 (bp->ut_type == BOOT_TIME) || (bp->ut_type == DOWN_TIME))