diff options
author | Helmut Grohne <helmut@subdivi.de> | 2009-01-23 12:56:20 +0000 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2009-01-23 12:56:20 +0000 |
commit | cea149b541f802d28b3a5b0cfa00441d3ac1f0e3 (patch) | |
tree | 1f5a91d5242e29f9c766c39fa7d2d0ed2f0a1fef /entropy.c | |
parent | 84194373370b46a346231c1762c038cc683abc45 (diff) | |
download | munin-plugins-busybox-cea149b541f802d28b3a5b0cfa00441d3ac1f0e3.tar.gz |
made more paths be macros
Diffstat (limited to 'entropy.c')
-rw-r--r-- | entropy.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2,6 +2,8 @@ #include <stdio.h> #include "common.h" +#define ENTROPY_AVAIL "/proc/sys/kernel/random/entropy_avail" + int entropy(int argc, char **argv) { FILE *f; int entropy; @@ -20,12 +22,12 @@ int entropy(int argc, char **argv) { if(!strcmp(argv[1], "autoconf")) return writeyes(); } - if(!(f=fopen("/proc/sys/kernel/random/entropy_avail", "r"))) { - fputs("cannot open /proc/sys/kernel/random/entropy_avail\n", stderr); + if(!(f=fopen(ENTROPY_AVAIL, "r"))) { + fputs("cannot open " ENTROPY_AVAIL "\n", stderr); return 1; } if(1 != fscanf(f, "%d", &entropy)) { - fputs("cannot read from /proc/sys/kernel/random/entropy_avail\n", stderr); + fputs("cannot read from " ENTROPY_AVAIL "\n", stderr); fclose(f); return 1; } |