dev_t ret = 0;
DBG(DEBUG_DEVNAME, printf("opening %s\n", lvm_device));
- if ((lvf = fopen(lvm_device, "r")) == NULL) {
+ if ((lvf = fopen_for_read(lvm_device)) == NULL) {
DBG(DEBUG_DEVNAME, printf("%s: (%d) %s\n", lvm_device, errno,
strerror(errno)));
return 0;
FILE *procpt;
char device[110];
- procpt = fopen(PROC_EVMS_VOLUMES, "r");
+ procpt = fopen_for_read(PROC_EVMS_VOLUMES);
if (!procpt)
return 0;
while (fgets(line, sizeof(line), procpt)) {
return -BLKID_ERR_PARAM;
if (cache->bic_flags & BLKID_BIC_FL_PROBED &&
- time(0) - cache->bic_time < BLKID_PROBE_INTERVAL)
+ time(NULL) - cache->bic_time < BLKID_PROBE_INTERVAL)
return 0;
blkid_read_cache(cache);
lvm_probe_all(cache);
#endif
- proc = fopen(PROC_PARTITIONS, "r");
+ proc = fopen_for_read(PROC_PARTITIONS);
if (!proc)
return -BLKID_ERR_PROC;
fclose(proc);
- cache->bic_time = time(0);
+ cache->bic_time = time(NULL);
cache->bic_flags |= BLKID_BIC_FL_PROBED;
blkid_flush_cache(cache);
return 0;