[BACK]Return to w.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / w

Diff for /src/usr.bin/w/w.c between version 1.6 and 1.7

version 1.6, 1996/08/12 02:28:43 version 1.7, 1996/08/22 02:12:33
Line 241 
Line 241 
                         continue;                          continue;
                 e = &kp->kp_eproc;                  e = &kp->kp_eproc;
                 for (ep = ehead; ep != NULL; ep = ep->next) {                  for (ep = ehead; ep != NULL; ep = ep->next) {
                         if (ep->tdev == e->e_tdev && e->e_pgid == e->e_tpgid) {                          /* ftp is a special case. */
                           if (strncmp(ep->utmp.ut_line, "ftp", 3) == 0) {
                                   pid_t fp = (pid_t)strtol(&ep->utmp.ut_line[3],
                                                            NULL, 10);
                                   if (p->p_pid == fp) {
                                           ep->kp = kp;
   
                                           break;
                                   }
                           } else if (ep->tdev == e->e_tdev
                                      && e->e_pgid == e->e_tpgid) {
                                 /*                                  /*
                                  * Proc is in foreground of this terminal                                   * Proc is in foreground of this terminal
                                  */                                   */
Line 324 
Line 334 
 pr_args(kp)  pr_args(kp)
         struct kinfo_proc *kp;          struct kinfo_proc *kp;
 {  {
         char **argv;          char **argv, *str;
         int left;          int left;
   
         if (kp == 0)          if (kp == 0)
Line 333 
Line 343 
         argv = kvm_getargv(kd, kp, argwidth);          argv = kvm_getargv(kd, kp, argwidth);
         if (argv == 0)          if (argv == 0)
                 goto nothing;                  goto nothing;
   
         while (*argv) {          while (*argv) {
                 fmt_puts(*argv, &left);                  /* ftp is a special case... */
                   if (strncmp(*argv, "ftpd:", 5) == 0) {
                           str = strrchr(*argv, ':');
                           if (str != (char *)NULL) {
                                   if (strlen(str) > 2)
                                           str += 2;
                                   fmt_puts(str, &left);
                           } else
                                   fmt_puts(*argv, &left);
                   } else
                           fmt_puts(*argv, &left);
                 argv++;                  argv++;
                 fmt_putc(' ', &left);                  fmt_putc(' ', &left);
         }          }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7