/*
- * $Id: cnid_metad.c,v 1.1.4.3 2003-10-28 07:24:02 didg Exp $
+ * $Id: cnid_metad.c,v 1.1.4.4 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#include <sys/uio.h>
#endif
#include <sys/un.h>
+#define _XPG4_2 1
#include <sys/socket.h>
#include <stdio.h>
#include <time.h>
/*
- * $Id: comm.c,v 1.1.4.3 2003-10-12 13:50:16 didg Exp $
+ * $Id: comm.c,v 1.1.4.4 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#endif
#include <sys/param.h>
+#define _XPG4_2 1
#include <sys/socket.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/uio.h>
#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
#include <assert.h>
#include <time.h>
#include "usockfd.h"
#include "comm.h"
+/* Length of the space taken up by a padded control message of length len */
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
+#endif
+
+
struct connection {
time_t tm; /* When respawned last */
int fd;
/*
- * $Id: comm.h,v 1.1.4.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: comm.h,v 1.1.4.2 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
extern int comm_snd __P((struct cnid_dbd_rply *));
extern int comm_nbe __P((void));
-
-
-
#endif /* CNID_DBD_COMM_H */
-
-
-
-
-
/*
- * $Id: db_param.c,v 1.1.4.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: db_param.c,v 1.1.4.2 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
-
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
/*
- * $Id: db_param.h,v 1.1.4.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: db_param.h,v 1.1.4.2 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#define CNID_DBD_DB_PARAM_H 1
#include <sys/param.h>
+#include <sys/cdefs.h>
struct db_param {
/*
- * $Id: dbd_delete.c,v 1.1.4.2 2003-10-21 16:24:58 didg Exp $
+ * $Id: dbd_delete.c,v 1.1.4.3 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#include <string.h>
#include <errno.h>
-#include <atalk/logger.h>
-
-#ifdef HAVE_DB4_DB_H
-#include <db4/db.h>
-#else
-#include <db.h>
-#endif
#include <netatalk/endian.h>
+#include <atalk/logger.h>
#include <atalk/cnid_dbd_private.h>
#include "dbif.h"
/*
- * $Id: dbd_get.c,v 1.1.4.2 2003-10-21 16:24:58 didg Exp $
+ * $Id: dbd_get.c,v 1.1.4.3 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#include <sys/param.h>
#include <atalk/logger.h>
#include <errno.h>
-
-#ifdef HAVE_DB4_DB_H
-#include <db4/db.h>
-#else
-#include <db.h>
-#endif
#include <netatalk/endian.h>
#include <atalk/cnid_dbd_private.h>
/*
- * $Id: dbd_lookup.c,v 1.1.4.2 2003-10-21 16:24:58 didg Exp $
+ * $Id: dbd_lookup.c,v 1.1.4.3 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
-#include <atalk/logger.h>
#include <errno.h>
-
-#ifdef HAVE_DB4_DB_H
-#include <db4/db.h>
-#else
-#include <db.h>
-#endif
#include <netatalk/endian.h>
+#include <atalk/logger.h>
#include <atalk/cnid_dbd_private.h>
#include "pack.h"
/*
- * $Id: dbd_resolve.c,v 1.1.4.2 2003-10-21 16:24:58 didg Exp $
+ * $Id: dbd_resolve.c,v 1.1.4.3 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#include <string.h>
#include <atalk/logger.h>
#include <errno.h>
-
-#ifdef HAVE_DB4_DB_H
-#include <db4/db.h>
-#else
-#include <db.h>
-#endif
#include <netatalk/endian.h>
#include <atalk/cnid_dbd_private.h>
/*
- * $Id: dbd_update.c,v 1.1.4.3 2003-10-21 16:24:58 didg Exp $
+ * $Id: dbd_update.c,v 1.1.4.4 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#include <string.h>
#include <errno.h>
#include <atalk/logger.h>
-
-#ifdef HAVE_DB4_DB_H
-#include <db4/db.h>
-#else
-#include <db.h>
-#endif
#include <netatalk/endian.h>
#include <atalk/cnid_dbd_private.h>
/*
- * $Id: dbif.c,v 1.1.4.4 2003-10-21 16:24:58 didg Exp $
+ * $Id: dbif.c,v 1.1.4.5 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#include <stdio.h>
#include <errno.h>
-
-#ifdef HAVE_DB4_DB_H
-#include <db4/db.h>
-#else
-#include <db.h>
-#endif
-#include <atalk/logger.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
-
#include <string.h>
-#include "db_param.h"
-#include "dbif.h"
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/cdefs.h>
#include <unistd.h>
+#include <atalk/logger.h>
+#include <db.h>
+#include "db_param.h"
+#include "dbif.h"
#define DB_ERRLOGFILE "db_errlog"
/*
- * $Id: dbif.h,v 1.1.4.3 2003-10-21 16:24:58 didg Exp $
+ * $Id: dbif.h,v 1.1.4.4 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#ifndef CNID_DBD_DBIF_H
#define CNID_DBD_DBIF_H 1
-#ifdef HAVE_DB4_DB_H
-#include <db4/db.h>
-#else
+#include <sys/cdefs.h>
#include <db.h>
-#endif
#include "db_param.h"
#define DBIF_DB_CNT 3
/*
- * $Id: main.c,v 1.1.4.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: main.c,v 1.1.4.2 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
-
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <string.h>
-
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#include <sys/stat.h>
#endif /* HAVE_SYS_STAT_H */
#include <time.h>
+#include <sys/file.h>
#include <netatalk/endian.h>
#include <atalk/cnid_dbd_private.h>
LOG(log_error, logtype_cnid, "main: error opening lockfile: %s", strerror(errno));
exit(1);
}
+#ifndef SOLARIS /* FIXME: Solaris doesn't have an flock implementation */
if (flock(lockfd, LOCK_EX | LOCK_NB) < 0) {
if (errno == EWOULDBLOCK) {
exit(0);
exit(1);
}
}
+#endif
LOG(log_info, logtype_cnid, "Startup, DB dir %s", dir);
sv.sa_handler = sig_exit;
if (dbif_close() < 0)
err++;
+#ifndef SOLARIS /* FIXME */
flock(lockfd, LOCK_UN);
+#endif
close(lockfd);
if (err)
/*
- * $Id: pack.c,v 1.1.4.2 2003-10-21 16:24:58 didg Exp $
+ * $Id: pack.c,v 1.1.4.3 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#include <sys/param.h>
-#ifdef HAVE_DB4_DB_H
-#include <db4/db.h>
-#else
+#include <sys/cdefs.h>
#include <db.h>
-#endif
#include <atalk/cnid_dbd_private.h>
#include <netatalk/endian.h>
/*
- * $Id: usockfd.h,v 1.1.4.1 2003-09-09 16:42:20 didg Exp $
+ * $Id: usockfd.h,v 1.1.4.2 2003-10-30 10:03:19 bfernhomberg Exp $
*
* Copyright (C) Joerg Lenneis 2003
* All Rights Reserved. See COPYRIGHT.
extern int tsockfd_create __P((char *, int, int));
extern int usockfd_check __P((int, unsigned long));
+#ifndef OSSH_ALIGNBYTES
+#define OSSH_ALIGNBYTES (sizeof(int) - 1)
+#endif
+#ifndef __CMSG_ALIGN
+#define __CMSG_ALIGN(p) (((u_int)(p) + OSSH_ALIGNBYTES) &~ OSSH_ALIGNBYTES)
+#endif
+
+/* Length of the contents of a control message of length len */
+#ifndef CMSG_LEN
+#define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+#endif
+
+/* Length of the space taken up by a padded control message of length len */
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
+#endif
+
+
#endif /* CNID_DBD_USOCKFD_H */