From: Alan T. DeKok Date: Fri, 17 Nov 2017 20:29:18 +0000 (-0500) Subject: differentiate ENOENT from other errors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63ab64fff4d1e67d2c7409d027be48725a9cb1bb;p=thirdparty%2Ffreeradius-server.git differentiate ENOENT from other errors --- diff --git a/src/modules/proto_detail/proto_detail_file.c b/src/modules/proto_detail/proto_detail_file.c index b5516590a8b..2b74e1e7649 100644 --- a/src/modules/proto_detail/proto_detail_file.c +++ b/src/modules/proto_detail/proto_detail_file.c @@ -454,7 +454,16 @@ static void work_init(proto_detail_file_t *inst) * If the work file didn't exist, try to rename detail* -> * detail.work, and return the newly opened file. */ - if (fd < 0) fd = work_rename(inst); + if (fd < 0) { + if (errno != ENOENT) { + DEBUG("proto_detail (%s): Failed opening %s: %s", + inst->name, inst->filename_work, + fr_syserror(errno)); + goto delay; + } + + fd = work_rename(inst); + } /* * The work file still doesn't exist. Go set up timers,