On 04/22/2015 05:58 AM, Mika Ilmaranta wrote:
> ---8<---
> diff -up postfix-3.0.1/src/util/scan_dir.c.reset-errno-before-readdir
> postfix-3.0.1/src/util/scan_dir.c
> --- postfix-3.0.1/src/util/scan_dir.c.reset-errno-before-readdir
> 2015-04-21 20:44:19.985338673 +0300
> +++ postfix-3.0.1/src/util/scan_dir.c 2015-04-21 20:47:32.791855824 +0300
> @@ -78,6 +78,7 @@
>  #endif
>  #endif
>  #include <string.h>
> +#include <errno.h>
> 
>  /* Utility library. */
> 
> @@ -177,6 +178,8 @@ char   *scan_dir_next(SCAN_DIR *scan)
>  #define STREQ(x,y)   (strcmp((x),(y)) == 0)
> 
>      if (info) {
> +     /* Some implementations report spurious errors. */
> +     errno = 0;
>       while ((dp = readdir(info->dir)) != 0) {
>           if (STREQ(dp->d_name, ".") || STREQ(dp->d_name, "..")) {
>               if (msg_verbose > 1)

I just tested this patch in CentOS 7, it gets rid of the following warning:

postconf: warning: /etc/postfix/dynamicmaps.cf.d: directory read error:
No such file or directory

I'm grateful because I was going to try to track down the source of that
warning (which was obviously incorrect because the db types defined in
the dynamicmaps.cf.d directory still worked fine) but now I don't have to.


Peter

Reply via email to