defs.c (59084) | defs.c (64698) |
---|---|
1/*- 2 * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org> 3 * 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org> 3 * 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/usr.sbin/ppp/defs.c 59084 2000-04-07 23:46:14Z brian $ | 26 * $FreeBSD: head/usr.sbin/ppp/defs.c 64698 2000-08-16 09:07:23Z brian $ |
27 */ 28 29 30#include <sys/types.h> 31#include <netdb.h> 32#include <netinet/in.h> 33#include <arpa/inet.h> 34#include <sys/socket.h> 35 36#include <ctype.h> 37#include <errno.h> | 27 */ 28 29 30#include <sys/types.h> 31#include <netdb.h> 32#include <netinet/in.h> 33#include <arpa/inet.h> 34#include <sys/socket.h> 35 36#include <ctype.h> 37#include <errno.h> |
38#ifdef __OpenBSD__ 39#include <util.h> 40#else 41#include <libutil.h> 42#endif |
|
38#include <stdio.h> 39#include <stdlib.h> 40#include <string.h> 41#include <termios.h> 42#if !defined(__FreeBSD__) || __FreeBSD__ < 3 43#include <time.h> 44#endif 45#include <unistd.h> --- 307 unchanged lines hidden (view full) --- 353 "redial", "reconnect" 354 }; 355 356 if (ex >= 0 && ex < sizeof desc / sizeof *desc) 357 return desc[ex]; 358 snprintf(num, sizeof num, "%d", ex); 359 return num; 360} | 43#include <stdio.h> 44#include <stdlib.h> 45#include <string.h> 46#include <termios.h> 47#if !defined(__FreeBSD__) || __FreeBSD__ < 3 48#include <time.h> 49#endif 50#include <unistd.h> --- 307 unchanged lines hidden (view full) --- 358 "redial", "reconnect" 359 }; 360 361 if (ex >= 0 && ex < sizeof desc / sizeof *desc) 362 return desc[ex]; 363 snprintf(num, sizeof num, "%d", ex); 364 return num; 365} |
366 367void 368SetTitle(const char *title) 369{ 370 if (title == NULL) 371 setproctitle(NULL); 372 else if (title[0] == '-' && title[1] != '\0') 373 setproctitle("-%s", title + 1); 374 else 375 setproctitle("%s", title); 376} |
|