#define strequal(a,b) (strcasecmp(a,b)==0)
#define BOOLSTR(b) ((b) ? "Yes" : "No")
typedef char pstring[1024];
-#define pstrcpy(a,b) strlcpy(a,b,sizeof(pstring)-1)
+#define pstrcpy(a,b) strlcpy(a,b,sizeof(pstring))
/* the following are used by loadparm for option lists */
typedef enum
char *exclude;
char *exclude_from;
char *log_format;
+ int timeout;
} service;
NULL, /* secrets file */
NULL, /* exclude */
NULL, /* exclude from */
- "%o %h [%a] %f %l", /* log format */
+ "%o %h [%a] %m (%u) %f %l", /* log format */
+ 0 /* timeout */
};
{"log file", P_STRING, P_GLOBAL, &Globals.log_file, NULL, 0},
{"pid file", P_STRING, P_GLOBAL, &Globals.pid_file, NULL, 0},
+ {"timeout", P_INTEGER, P_LOCAL, &sDefault.timeout, NULL, 0},
{"name", P_STRING, P_LOCAL, &sDefault.name, NULL, 0},
{"comment", P_STRING, P_LOCAL, &sDefault.comment, NULL, 0},
{"path", P_STRING, P_LOCAL, &sDefault.path, NULL, 0},
FN_LOCAL_STRING(lp_exclude, exclude)
FN_LOCAL_STRING(lp_exclude_from, exclude_from)
FN_LOCAL_STRING(lp_log_format, log_format)
+FN_LOCAL_INTEGER(lp_timeout, timeout)
/* local prototypes */
static int strwicmp( char *psz1, char *psz2 );
return;
}
*s = strdup(v);
- if (!*s) exit_cleanup(1);
+ if (!*s) exit_cleanup(RERR_MALLOC);
}
break;
case P_GSTRING:
- strlcpy((char *)parm_ptr,parmvalue,sizeof(pstring)-1);
+ strlcpy((char *)parm_ptr,parmvalue,sizeof(pstring));
break;
case P_ENUM: