summaryrefslogtreecommitdiff
path: root/fw_packets.c
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2009-01-23 12:56:20 +0000
committerHelmut Grohne <helmut@subdivi.de>2009-01-23 12:56:20 +0000
commitcea149b541f802d28b3a5b0cfa00441d3ac1f0e3 (patch)
tree1f5a91d5242e29f9c766c39fa7d2d0ed2f0a1fef /fw_packets.c
parent84194373370b46a346231c1762c038cc683abc45 (diff)
downloadmunin-plugins-busybox-cea149b541f802d28b3a5b0cfa00441d3ac1f0e3.tar.gz
made more paths be macros
Diffstat (limited to 'fw_packets.c')
-rw-r--r--fw_packets.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fw_packets.c b/fw_packets.c
index 06367dd..8e94fde 100644
--- a/fw_packets.c
+++ b/fw_packets.c
@@ -4,6 +4,8 @@
#include <ctype.h>
#include "common.h"
+#define PROC_NET_SNMP "/proc/net/snmp"
+
int fw_packets(int argc, char **argv) {
FILE *f;
char buff[1024], *s;
@@ -24,14 +26,14 @@ int fw_packets(int argc, char **argv) {
return 0;
}
if(!strcmp(argv[1], "autoconf")) {
- if(0 == access("/proc/net/snmp", R_OK))
+ if(0 == access(PROC_NET_SNMP, R_OK))
return writeyes();
else
- return writeno("/proc/net/snmp not readable");
+ return writeno(PROC_NET_SNMP " not readable");
}
}
- if(!(f=fopen("/proc/net/snmp", "r"))) {
- fputs("cannot open /proc/net/snmp\n", stderr);
+ if(!(f=fopen(PROC_NET_SNMP, "r"))) {
+ fputs("cannot open " PROC_NET_SNMP "\n", stderr);
return 1;
}
while(fgets(buff, 1024, f)) {
@@ -55,6 +57,6 @@ int fw_packets(int argc, char **argv) {
}
}
fclose(f);
- fputs("no ip line found in /proc/net/snmp\n", stderr);
+ fputs("no ip line found in " PROC_NET_SNMP "\n", stderr);
return 1;
}