From: Alan T. DeKok Date: Wed, 25 Nov 2015 16:46:52 +0000 (-0500) Subject: Complain if error isn't ENOENT. Fixes #1398 X-Git-Tag: release_3_0_11~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51413a99597783ccc7a2066e7d48dca219aee356;p=thirdparty%2Ffreeradius-server.git Complain if error isn't ENOENT. Fixes #1398 --- diff --git a/src/main/detail.c b/src/main/detail.c index da522358df8..6788838542d 100644 --- a/src/main/detail.c +++ b/src/main/detail.c @@ -203,6 +203,20 @@ static int detail_open(rad_listen_t *this) */ data->fp = NULL; data->work_fd = open(data->filename_work, O_RDWR); + + /* + * Couldn't open it for a reason OTHER than "it doesn't + * exist". Complain and tell the admin. + */ + if ((data->work_fd < 0) && (errno != ENOENT)) { + ERROR("Failed opening detail file %s: %s", + data->filename_work, strerror(errno)); + return 0; + } + + /* + * The file doesn't exist. Poll for it again. + */ if (data->work_fd < 0) { #ifndef HAVE_GLOB_H return 0;