confuse-devel
[Top][All Lists]
Advanced

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

[Confuse-devel] bug?


From: Freddy
Subject: [Confuse-devel] bug?
Date: Sun, 23 Mar 2003 07:58:20 +0100

Hi!

I started to write a daemon program in C using libconfuse (version 1.2.3) as 
its configuration
file parser. When the daemon starts it reads its configuration file (config 
later on) and daemonizes
itself into the background. An important requirement that the config can be 
re-readed at any time
without stopping the running daemon program. It works well if the config 
doesn't contain any errors.
But I've noticed if I make an error (I simply put an 'x' into the config) 
libconfuse behaves interesting.
At the first re-reading attempt it gives a quite correct error message: 
"xxxx.conf:6: no such option 'x'",
but second time the line in the error message migrates to the last line of the 
config:
"xxxx.conf:72: no such option 'x'". After I corrected the config (deleting 'x' 
from line 6) cfg_size()
function gives back a false value: two times more sections than I have in fact. 
Then the daemon
tries to read the sections sequentially (0,1,2,etc) and it will get the first 
again when reached the last.
For example I have three sections then cfg_getnsec() gives back sections in 
order: 0,1,2,0,1,2
(when the running code reaches command sec=cfg_getnsec(cfg,"section",3) it will 
get the first section
again and so on). At the next re-reading the errors disappear.

Sorry for my English and I hope my description is clear enough :)
I would really appreciate any advices in connection with my problem.

Freddy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]