bool parseFile(nsjconf_t* nsjconf, const char* file) {
LOG_D("Parsing configuration from '%s'", file);
- int fd = open(file, O_RDONLY | O_CLOEXEC);
+ int fd = TEMP_FAILURE_RETRY(open(file, O_RDONLY | O_CLOEXEC));
if (fd == -1) {
PLOG_W("Couldn't open config file '%s'", file);
return false;
}
ssize_t readFromFile(const char* fname, void* buf, size_t len) {
- int fd;
- TEMP_FAILURE_RETRY(fd = open(fname, O_RDONLY | O_CLOEXEC));
+ int fd = TEMP_FAILURE_RETRY(open(fname, O_RDONLY | O_CLOEXEC));
if (fd == -1) {
LOG_E("open('%s', O_RDONLY|O_CLOEXEC)", fname);
return -1;
return;
}
#endif /* defined(__NR_getrandom) */
- int fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC);
+ int fd = TEMP_FAILURE_RETRY(open("/dev/urandom", O_RDONLY | O_CLOEXEC));
if (fd == -1) {
PLOG_D(
"Couldn't open /dev/urandom for reading. Using gettimeofday "