utility.c (72445) | utility.c (78527) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 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 --- 20 unchanged lines hidden (view full) --- 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#define PRINTOPTIONS 35#include "telnetd.h" 36 | 1/* 2 * Copyright (c) 1989, 1993 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 --- 20 unchanged lines hidden (view full) --- 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#define PRINTOPTIONS 35#include "telnetd.h" 36 |
37RCSID("$Id: utility.c,v 1.23 2000/10/08 13:34:27 assar Exp $"); | 37RCSID("$Id: utility.c,v 1.25 2001/05/17 00:34:42 assar Exp $"); |
38 39/* 40 * utility functions performing io related tasks 41 */ 42 43/* 44 * ttloop 45 * --- 312 unchanged lines hidden (view full) --- 358 } 359#endif 360 write(f, buf, (int)strlen(buf)); 361 sleep(1); /*XXX*/ 362 exit(1); 363} 364 365void | 38 39/* 40 * utility functions performing io related tasks 41 */ 42 43/* 44 * ttloop 45 * --- 312 unchanged lines hidden (view full) --- 358 } 359#endif 360 write(f, buf, (int)strlen(buf)); 361 sleep(1); /*XXX*/ 362 exit(1); 363} 364 365void |
366fatalperror(int f, const char *msg) | 366fatalperror_errno(int f, const char *msg, int error) |
367{ 368 char buf[BUFSIZ]; 369 | 367{ 368 char buf[BUFSIZ]; 369 |
370 snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(errno)); | 370 snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(error)); |
371 fatal(f, buf); 372} 373 | 371 fatal(f, buf); 372} 373 |
374void 375fatalperror(int f, const char *msg) 376{ 377 fatalperror_errno(f, msg, errno); 378} 379 |
|
374char editedhost[32]; 375 376void edithost(char *pat, char *host) 377{ 378 char *res = editedhost; 379 380 if (!pat) 381 pat = ""; --- 784 unchanged lines hidden --- | 380char editedhost[32]; 381 382void edithost(char *pat, char *host) 383{ 384 char *res = editedhost; 385 386 if (!pat) 387 pat = ""; --- 784 unchanged lines hidden --- |