aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Eckenfels <net-tools@lina.inka.de>2007-12-01 18:51:09 +0000
committerBernd Eckenfels <net-tools@lina.inka.de>2007-12-01 18:51:09 +0000
commiteb21d0e2f700a18e67e7a3523c538b3482671fe9 (patch)
tree9b500ee50e6ecaa10d0d4433049d5f22c879e48d
parentFaster pagesize aligned fopen for netstat -s (Eric Dumazet) (diff)
downloadnet-tools-eb21d0e2f700a18e67e7a3523c538b3482671fe9.tar.gz
net-tools-eb21d0e2f700a18e67e7a3523c538b3482671fe9.tar.bz2
net-tools-eb21d0e2f700a18e67e7a3523c538b3482671fe9.zip
Page aligned fopen buffer
-rw-r--r--rarp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/rarp.c b/rarp.c
index aab05b3..7c27624 100644
--- a/rarp.c
+++ b/rarp.c
@@ -3,7 +3,7 @@
* that maintains the kernel's RARP cache. It is derived
* from Fred N. van Kempen's arp command.
*
- * Version: $Id: rarp.c,v 1.6 2001/04/08 17:05:05 pb Exp $
+ * Version: $Id: rarp.c,v 1.7 2007/12/01 18:51:09 ecki Exp $
*
* Usage: rarp -d hostname Delete entry
* rarp -s hostname ethernet_address Add entry
@@ -40,6 +40,7 @@
#include "net-support.h"
#include "version.h"
#include "pathnames.h"
+#include "proc.h"
static char no_rarp_message[] = N_("This kernel does not support RARP.\n");
@@ -124,7 +125,7 @@ static int rarp_file(int fd, const char *name)
FILE *fp;
struct hostent *hp;
- if ((fp = fopen(name, "r")) == NULL) {
+ if ((fp = proc_fopen(name)) == NULL) {
fprintf(stderr, _("rarp: cannot open file %s:%s.\n"), name, strerror(errno));
return -1;
}
@@ -154,7 +155,7 @@ static int rarp_file(int fd, const char *name)
static int display_cache(void)
{
- FILE *fd = fopen(_PATH_PROCNET_RARP, "r");
+ FILE *fd = proc_fopen(_PATH_PROCNET_RARP);
char buffer[256];
if (fd == NULL) {
if (errno == ENOENT)