w.c (45946) | w.c (48566) |
---|---|
1/*- 2 * Copyright (c) 1980, 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94"; 43#endif 44static const char rcsid[] = | 1/*- 2 * Copyright (c) 1980, 1991, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 28 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)w.c 8.4 (Berkeley) 4/16/94"; 43#endif 44static const char rcsid[] = |
45 "$Id: w.c,v 1.33 1999/03/31 21:01:39 brian Exp $"; | 45 "$Id: w.c,v 1.34 1999/04/22 23:40:56 ache Exp $"; |
46#endif /* not lint */ 47 48/* 49 * w - print system status (who and what) 50 * 51 * This program is similar to the systat command on Tenex/Tops 10/20 52 * 53 */ --- 266 unchanged lines hidden (view full) --- 320 continue; 321 save = from; 322 from = from->next; 323 save->next = *nextp; 324 *nextp = save; 325 } 326 } 327 | 46#endif /* not lint */ 47 48/* 49 * w - print system status (who and what) 50 * 51 * This program is similar to the systat command on Tenex/Tops 10/20 52 * 53 */ --- 266 unchanged lines hidden (view full) --- 320 continue; 321 save = from; 322 from = from->next; 323 save->next = *nextp; 324 *nextp = save; 325 } 326 } 327 |
328 if (!nflag) | 328 if (!nflag) { |
329 if (gethostname(domain, sizeof(domain) - 1) < 0 || 330 (p = strchr(domain, '.')) == 0) 331 domain[0] = '\0'; 332 else { 333 domain[sizeof(domain) - 1] = '\0'; 334 memmove(domain, p, strlen(p) + 1); 335 } | 329 if (gethostname(domain, sizeof(domain) - 1) < 0 || 330 (p = strchr(domain, '.')) == 0) 331 domain[0] = '\0'; 332 else { 333 domain[sizeof(domain) - 1] = '\0'; 334 memmove(domain, p, strlen(p) + 1); 335 } |
336 } |
|
336 337 for (ep = ehead; ep != NULL; ep = ep->next) { 338 char host_buf[UT_HOSTSIZE + 1]; 339 340 host_buf[UT_HOSTSIZE] = '\0'; 341 strncpy(host_buf, ep->utmp.ut_host, UT_HOSTSIZE); 342 p = *host_buf ? host_buf : "-"; 343 if ((x = strchr(p, ':')) != NULL) --- 171 unchanged lines hidden --- | 337 338 for (ep = ehead; ep != NULL; ep = ep->next) { 339 char host_buf[UT_HOSTSIZE + 1]; 340 341 host_buf[UT_HOSTSIZE] = '\0'; 342 strncpy(host_buf, ep->utmp.ut_host, UT_HOSTSIZE); 343 p = *host_buf ? host_buf : "-"; 344 if ((x = strchr(p, ':')) != NULL) --- 171 unchanged lines hidden --- |