+ /* Add a suffix to the program name if this is a process with a
+ * none default configuration file name. */
+ if (strcmp( CONFIGFILE, get_dyn_CONFIGFILE()) == 0) {
+ name = SMB_STRDUP(program_name);
+ } else {
+ short_configfile = strrchr( get_dyn_CONFIGFILE(), '/');
+ if (short_configfile == NULL) {
+ /* conf file in current directory */
+ short_configfile = get_dyn_CONFIGFILE();
+ } else {
+ /* full/relative path provided */
+ short_configfile++;
+ }
+ if (asprintf(&name, "%s-%s", program_name,
+ short_configfile) == -1) {
+ smb_panic("asprintf failed");
+ }
+ }
+