On 04/21/2015 07:57 PM, Wietse Venema wrote: > --- /var/tmp/postfix-3.1-20150330/src/util/scan_dir.c 2014-12-06 > 20:35:33.000000000 -0500
Wietse didn't notice that errno.h is also needed. //Mika ---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) -- Mika Ilmaranta <il...@foobar.fi> Foobar Linux services +358 50 3023638 Foobar Oy <http://foobar.fi/>