diff -up man-db-2.6.3/src/check_mandirs.c.gcc man-db-2.6.3/src/check_mandirs.c --- man-db-2.6.3/src/check_mandirs.c.gcc 2013-03-18 13:56:24.000000000 +0100 +++ man-db-2.6.3/src/check_mandirs.c 2013-03-18 14:03:20.081132550 +0100 @@ -440,7 +440,10 @@ static int testmandirs (const char *path return 0; } - chdir (path); + if (chdir (path) != 0) { + error (0, errno, _("can't change to directory %s"), path); + return 0; + } while( (mandir = readdir (dir)) ) { if (strncmp (mandir->d_name, "man", 3) != 0)