From e49d7578a80c741e005cd69b06269f4c5038cee9 Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Mon, 13 Sep 2010 17:18:07 +0200 Subject: [PATCH] Always check before committing, fix for cnid_metad PID lockfile --- etc/cnid_dbd/cnid_metad.c | 3 ++- include/atalk/paths.h | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/etc/cnid_dbd/cnid_metad.c b/etc/cnid_dbd/cnid_metad.c index d38dab4e..09f90485 100644 --- a/etc/cnid_dbd/cnid_metad.c +++ b/etc/cnid_dbd/cnid_metad.c @@ -95,6 +95,7 @@ #include #include #include +#include #include "db_param.h" #include "usockfd.h" @@ -484,7 +485,7 @@ int main(int argc, char *argv[]) } /* Check PID lockfile and become a daemon */ - switch(server_lock("cnid_metad", _PATH_LOCKDIR, 0)) { + switch(server_lock("cnid_metad", _PATH_CNID_METAD_LOCK, 0)) { case -1: /* error */ exit(EXITERR_SYS); case 0: /* child */ diff --git a/include/atalk/paths.h b/include/atalk/paths.h index 2d7d91bd..2e75b461 100644 --- a/include/atalk/paths.h +++ b/include/atalk/paths.h @@ -77,4 +77,13 @@ # define _PATH_AFPDLOCK ATALKPATHCAT(_PATH_LOCKDIR,"afpd") #endif +/* + * cnid_metad paths + */ +#if defined (FHS_COMPATIBILITY) || defined (__NetBSD__) +# define _PATH_CNID_METAD_LOCK ATALKPATHCAT(_PATH_LOCKDIR,"cnid_metad.pid") +#else +# define _PATH_CNID_METAD_LOCK ATALKPATHCAT(_PATH_LOCKDIR,"cnid_metad") +#endif + #endif /* atalk/paths.h */ -- 2.39.2