/*
- * $Id: cnid_metad.c,v 1.11 2009-05-26 07:16:56 franklahm Exp $
+ * $Id: cnid_metad.c,v 1.15 2009-10-13 22:55:37 didg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYING.
#define WTERMSIG(status) ((status) & 0x7f)
#endif
-#ifdef ATACC
-#define fork aTaC_fork
-#endif
-
/* functions for username and group */
#include <pwd.h>
#include <grp.h>
#endif
#endif
+#include <atalk/util.h>
#include <atalk/logger.h>
#include <atalk/cnid_dbd_private.h>
static struct server srv[MAXVOLS];
/* Default logging config: log to syslog with level log_note */
-static char *logconfig = "default log_note";
+static char logconfig[MAXPATHLEN + 21 + 1] = "default log_note";
static struct server *test_usockfn(char *dir)
{
}
/* ------------------ */
-uid_t user_to_uid ( username )
- char *username;
+uid_t user_to_uid (char *username)
{
struct passwd *this_passwd;
}
/* ------------------ */
-gid_t group_to_gid ( group )
- char *group;
+gid_t group_to_gid ( char *group)
{
struct group *this_group;
}
/* ------------------ */
-void catch_alarm(int sig) {
+void catch_alarm(int sig _U_) {
alarmed = 1;
}
int err = 0;
int debug = 0;
int ret;
+ char *loglevel = NULL;
+ char *logfile = NULL;
set_processname("cnid_metad");
- while (( cc = getopt( argc, argv, "ds:p:h:u:g:l:")) != -1 ) {
+ while (( cc = getopt( argc, argv, "ds:p:h:u:g:l:f:")) != -1 ) {
switch (cc) {
case 'd':
debug = 1;
dbdpn = strdup(optarg);
break;
case 'l':
- logconfig = strdup(optarg);
+ loglevel = strdup(optarg);
+ break;
+ case 'f':
+ logfile = strdup(optarg);
break;
default:
err++;
}
}
+ if (loglevel) {
+ strlcpy(logconfig + 8, loglevel, 13);
+ free(loglevel);
+ strcat(logconfig, " ");
+ }
+ if (logfile) {
+ strlcat(logconfig, logfile, MAXPATHLEN);
+ free(logfile);
+ }
setuplog(logconfig);
if (err) {