[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] Leafnode 1: Noticed a bug in xoverutil.c

In reviewing my various and sundry log files, I noticed the following showing up: fetchnews[19025]: [ID 702911 news.error] error: cannot rmdir(/news/comp/databases): File exists
Which is true as /news/comp/database/xbase is still populated.

So I went looking and found that the rmdir(2) call in killcwd() checks for ENOTEMPTY as a no error condition, and not EEXIST which Solaris 11.3 returns.

This turns out to be one of those "POSIX allows for ..." cases, so here is the unified diff to add checking for EEXIST. (Against 1.11.10, but xoverutil.c has not changed.)

        Gary    B-)

--- ./leafnode-1.11.10/xoverutil.c      Sat Jan 31 02:02:52 2009
+++ ./leafnode-1.11.11/xoverutil.c      Tue Dec 13 15:27:53 2016
@@ -386,7 +386,7 @@
        if (chdir(spooldir)) {
ln_log(LNLOG_SERR, LNLOG_CTOP, "error: cannot chdir(%s): %m", spooldir);
-       if (rmdir(t) && errno != ENOTEMPTY) {
+       if (rmdir(t) && errno != ENOTEMPTY && errno != EEXIST) {
ln_log(LNLOG_SERR, LNLOG_CTOP, "error: cannot rmdir(%s): %m", t);

leafnode-list mailing list