Xymon Mailing List Archive search

Bug and patch - directory name not displayed in error message

list John Horne
Mon, 12 Mar 2012 16:14:41 +0000
Message-Id: <user-fb7c1c4228c6@xymon.invalid>

Hello,

Using Xymon 4.3.7 I see in my /var/log/xymon/xymonlaunch.log log file
the following error:

===================================
2012-03-12 16:07:57 Loading tasklist configuration
from /home/xymon/server/etc/tasks.cfg
2012-03-12 16:07:57 Cannot open directory
===================================

This isn't too much use since it doesn't say what directory it is trying
to open.

It seems the problem is in the file lib/stackio.c (around line 338). A
patch to fix this is here:

==========================================
--- lib/stackio.c.orig  2011-07-31 22:01:52.000000000 +0100
+++ lib/stackio.c       2012-03-12 16:07:34.619479967 +0000
@@ -338,7 +338,7 @@
        if (*dirname == '/') strcpy(dirfn, dirname); else sprintf(dirfn,
"%s/%s", stackfd_base, dirname);
 
        if ((dirfd = opendir(dirfn)) == NULL) {
-               errprintf("Cannot open directory %s\n", fn);
+               errprintf("Cannot open directory %s\n", dirfn);
                return;
        }
 
==========================================

(Sorry about the line wrapping.)


John.

-- 
John Horne                   Tel: +XX (X)XXXX XXXXXX
Plymouth University, UK      Fax: +XX (X)XXXX XXXXXX