diff options
-rw-r--r-- | init/bootchartd.c | 10 | ||||
-rw-r--r-- | miscutils/i2c_tools.c | 6 | ||||
-rw-r--r-- | networking/nslookup.c | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/init/bootchartd.c b/init/bootchartd.c index 750f67356..ae1ee9d9a 100644 --- a/init/bootchartd.c +++ b/init/bootchartd.c | |||
@@ -218,10 +218,10 @@ static char *make_tempdir(void) | |||
218 | 218 | ||
219 | static void do_logging(unsigned sample_period_us, int process_accounting) | 219 | static void do_logging(unsigned sample_period_us, int process_accounting) |
220 | { | 220 | { |
221 | FILE *proc_stat = xfopen("proc_stat.log", "w"); | 221 | FILE *proc_stat = xfopen_for_write("proc_stat.log"); |
222 | FILE *proc_diskstats = xfopen("proc_diskstats.log", "w"); | 222 | FILE *proc_diskstats = xfopen_for_write("proc_diskstats.log"); |
223 | //FILE *proc_netdev = xfopen("proc_netdev.log", "w"); | 223 | //FILE *proc_netdev = xfopen_for_write("proc_netdev.log"); |
224 | FILE *proc_ps = xfopen("proc_ps.log", "w"); | 224 | FILE *proc_ps = xfopen_for_write("proc_ps.log"); |
225 | int look_for_login_process = (getppid() == 1); | 225 | int look_for_login_process = (getppid() == 1); |
226 | unsigned count = 60*1000*1000 / sample_period_us; /* ~1 minute */ | 226 | unsigned count = 60*1000*1000 / sample_period_us; /* ~1 minute */ |
227 | 227 | ||
@@ -268,7 +268,7 @@ static void finalize(char *tempdir, const char *prog, int process_accounting) | |||
268 | //local pacct= | 268 | //local pacct= |
269 | //[ -e kernel_pacct ] && pacct=kernel_pacct | 269 | //[ -e kernel_pacct ] && pacct=kernel_pacct |
270 | 270 | ||
271 | FILE *header_fp = xfopen("header", "w"); | 271 | FILE *header_fp = xfopen_for_write("header"); |
272 | 272 | ||
273 | if (process_accounting) | 273 | if (process_accounting) |
274 | acct(NULL); | 274 | acct(NULL); |
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index cda17ee00..48135921d 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c | |||
@@ -1149,12 +1149,12 @@ static void NORETURN list_i2c_busses_and_exit(void) | |||
1149 | /* Simple version for ISA chips. */ | 1149 | /* Simple version for ISA chips. */ |
1150 | snprintf(path, NAME_MAX, "%s/%s/name", | 1150 | snprintf(path, NAME_MAX, "%s/%s/name", |
1151 | i2cdev_path, de->d_name); | 1151 | i2cdev_path, de->d_name); |
1152 | fp = fopen(path, "r"); | 1152 | fp = fopen_for_read(path); |
1153 | if (fp == NULL) { | 1153 | if (fp == NULL) { |
1154 | snprintf(path, NAME_MAX, | 1154 | snprintf(path, NAME_MAX, |
1155 | "%s/%s/device/name", | 1155 | "%s/%s/device/name", |
1156 | i2cdev_path, de->d_name); | 1156 | i2cdev_path, de->d_name); |
1157 | fp = fopen(path, "r"); | 1157 | fp = fopen_for_read(path); |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | /* Non-ISA chips require the hard-way. */ | 1160 | /* Non-ISA chips require the hard-way. */ |
@@ -1175,7 +1175,7 @@ static void NORETURN list_i2c_busses_and_exit(void) | |||
1175 | "%s/%s/device/%s/name", | 1175 | "%s/%s/device/%s/name", |
1176 | i2cdev_path, de->d_name, | 1176 | i2cdev_path, de->d_name, |
1177 | subde->d_name); | 1177 | subde->d_name); |
1178 | fp = fopen(path, "r"); | 1178 | fp = fopen_for_read(path); |
1179 | break; | 1179 | break; |
1180 | } | 1180 | } |
1181 | } | 1181 | } |
diff --git a/networking/nslookup.c b/networking/nslookup.c index dda22de0e..5aa2b35d2 100644 --- a/networking/nslookup.c +++ b/networking/nslookup.c | |||
@@ -697,7 +697,7 @@ static void parse_resolvconf(void) | |||
697 | { | 697 | { |
698 | FILE *resolv; | 698 | FILE *resolv; |
699 | 699 | ||
700 | resolv = fopen("/etc/resolv.conf", "r"); | 700 | resolv = fopen_for_read("/etc/resolv.conf"); |
701 | if (resolv) { | 701 | if (resolv) { |
702 | char line[512]; /* "search" is defined to be up to 256 chars */ | 702 | char line[512]; /* "search" is defined to be up to 256 chars */ |
703 | 703 | ||