diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-03-06 20:54:43 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-03-06 20:54:43 +0000 |
commit | 0f430e34af3471b5267cd6b00a803559ab7fb110 (patch) | |
tree | 3522a5761367651f520d8dfe2b089b7d7bd3479b | |
parent | 36278b957630afbe603c632fe21792ed497df149 (diff) | |
download | busybox-w32-0f430e34af3471b5267cd6b00a803559ab7fb110.tar.gz busybox-w32-0f430e34af3471b5267cd6b00a803559ab7fb110.tar.bz2 busybox-w32-0f430e34af3471b5267cd6b00a803559ab7fb110.zip |
Fix up some silly macros and use xmalloc and friends exclusively.
-rw-r--r-- | interface.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/interface.c b/interface.c index 05019e5eb..4df1a721a 100644 --- a/interface.c +++ b/interface.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * that either displays or sets the characteristics of | 3 | * that either displays or sets the characteristics of |
4 | * one or more of the system's networking interfaces. | 4 | * one or more of the system's networking interfaces. |
5 | * | 5 | * |
6 | * Version: $Id: interface.c,v 1.1 2001/03/06 00:48:59 andersen Exp $ | 6 | * Version: $Id: interface.c,v 1.2 2001/03/06 20:54:43 andersen Exp $ |
7 | * | 7 | * |
8 | * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> | 8 | * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> |
9 | * and others. Copyright 1993 MicroWalt Corporation | 9 | * and others. Copyright 1993 MicroWalt Corporation |
@@ -73,9 +73,6 @@ | |||
73 | #define _(x) x | 73 | #define _(x) x |
74 | #define _PATH_PROCNET_DEV "/proc/net/dev" | 74 | #define _PATH_PROCNET_DEV "/proc/net/dev" |
75 | #define new(p) ((p) = xcalloc(1,sizeof(*(p)))) | 75 | #define new(p) ((p) = xcalloc(1,sizeof(*(p)))) |
76 | #define xmalloc malloc | ||
77 | #define xcalloc calloc | ||
78 | #define xrealloc realloc | ||
79 | #define KRELEASE(maj,min,patch) ((maj) * 10000 + (min)*1000 + (patch)) | 76 | #define KRELEASE(maj,min,patch) ((maj) * 10000 + (min)*1000 + (patch)) |
80 | 77 | ||
81 | int procnetdev_vsn = 1; | 78 | int procnetdev_vsn = 1; |
@@ -391,11 +388,11 @@ static int INET_rresolve(char *name, size_t len, struct sockaddr_in *sin, | |||
391 | } | 388 | } |
392 | if ((ent == NULL) && (np == NULL)) | 389 | if ((ent == NULL) && (np == NULL)) |
393 | safe_strncpy(name, inet_ntoa(sin->sin_addr), len); | 390 | safe_strncpy(name, inet_ntoa(sin->sin_addr), len); |
394 | pn = (struct addr *) malloc(sizeof(struct addr)); | 391 | pn = (struct addr *) xmalloc(sizeof(struct addr)); |
395 | pn->addr = *sin; | 392 | pn->addr = *sin; |
396 | pn->next = INET_nn; | 393 | pn->next = INET_nn; |
397 | pn->host = host; | 394 | pn->host = host; |
398 | pn->name = (char *) malloc(strlen(name) + 1); | 395 | pn->name = (char *) xmalloc(strlen(name) + 1); |
399 | strcpy(pn->name, name); | 396 | strcpy(pn->name, name); |
400 | INET_nn = pn; | 397 | INET_nn = pn; |
401 | 398 | ||