summaryrefslogtreecommitdiffstats
path: root/source/lib/pidfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/pidfile.c')
-rw-r--r--source/lib/pidfile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/lib/pidfile.c b/source/lib/pidfile.c
index 49626acade5..89ab6d799b7 100644
--- a/source/lib/pidfile.c
+++ b/source/lib/pidfile.c
@@ -93,6 +93,13 @@ void pidfile_create(const char *program_name)
strncpy( name, program_name, sizeof( name)-1);
} else {
short_configfile = strrchr( dyn_CONFIGFILE, '/');
+ if (short_configfile == NULL) {
+ /* conf file in current directory */
+ short_configfile = dyn_CONFIGFILE;
+ } else {
+ /* full/relative path provided */
+ short_configfile++;
+ }
slprintf( name, sizeof( name)-1, "%s-%s", program_name, short_configfile+1);
}