]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
differentiate ENOENT from other errors
authorAlan T. DeKok <aland@freeradius.org>
Fri, 17 Nov 2017 20:29:18 +0000 (15:29 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 17 Nov 2017 20:29:18 +0000 (15:29 -0500)
src/modules/proto_detail/proto_detail_file.c

index b5516590a8b3bb085ef6fa540cf2238582958def..2b74e1e7649829a1dc85fadcfd894106e85fd045 100644 (file)
@@ -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,