X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=util.c;h=03c60af98daa527222c87214cb14d60edc6c1a9b;hp=f3af9567cf49cb79043977511e52b2112e0361b9;hb=2f357920ffd58e7b56940c64ab8d14a83a27b9f1;hpb=a5dab5ce0fd4aafc394afe30eda0e6b01a13256b diff --git a/util.c b/util.c index f3af9567c..03c60af98 100644 --- a/util.c +++ b/util.c @@ -1162,10 +1162,15 @@ int close_all_fds(const int except[], unsigned n_except) { continue; } - if ((r = close_nointr(fd)) < 0) - goto finish; + if ((r = close_nointr(fd)) < 0) { + /* Valgrind has its own FD and doesn't want to have it closed */ + if (errno != EBADF) + goto finish; + } } + r = 0; + finish: closedir(d); return r;