]> arthur.barton.de Git - netatalk.git/commitdiff
fix most solaris compile issues, flock is #ifdef as solaris has no flock implementati...
authorbfernhomberg <bfernhomberg>
Thu, 30 Oct 2003 10:03:19 +0000 (10:03 +0000)
committerbfernhomberg <bfernhomberg>
Thu, 30 Oct 2003 10:03:19 +0000 (10:03 +0000)
15 files changed:
etc/cnid_dbd/cnid_metad.c
etc/cnid_dbd/comm.c
etc/cnid_dbd/comm.h
etc/cnid_dbd/db_param.c
etc/cnid_dbd/db_param.h
etc/cnid_dbd/dbd_delete.c
etc/cnid_dbd/dbd_get.c
etc/cnid_dbd/dbd_lookup.c
etc/cnid_dbd/dbd_resolve.c
etc/cnid_dbd/dbd_update.c
etc/cnid_dbd/dbif.c
etc/cnid_dbd/dbif.h
etc/cnid_dbd/main.c
etc/cnid_dbd/pack.c
etc/cnid_dbd/usockfd.h

index 4e8541b15ab126c7c00ec4558c5da53e53b70c9b..b8db46539c707d960d7e7ed661c59651d47ecf06 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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.
@@ -36,6 +36,7 @@
 #include <sys/uio.h>
 #endif
 #include <sys/un.h>
+#define _XPG4_2 1
 #include <sys/socket.h>
 #include <stdio.h>
 #include <time.h>
index 83272e1ce06dc943ed0be6af1637891e02b45ba5..db9c8539d1985dd9c45a8475523dc73d04014e52 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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.
@@ -19,6 +19,7 @@
 #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;
index 304ac2ebc3ee662ec5641ec25650a3cc4dc4a38a..fb676d9189aa15071e461a7b2c8e8a10e05824cc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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.
@@ -17,13 +17,5 @@ extern int      comm_rcv  __P((struct cnid_dbd_rqst *));
 extern int      comm_snd  __P((struct cnid_dbd_rply *));
 extern int      comm_nbe  __P((void));
 
-
-
-
 #endif /* CNID_DBD_COMM_H */
 
-
-
-
-
-
index 25bfb93356835fd29aa73a5e0fda9c9948b85432..d3cea05d9a1bd2df2e5017dd57f10f1b7fb17d39 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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.
@@ -12,7 +12,9 @@
 #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>
index 16a518cdef8bed8f17ff45f40e9d4b6a4e34778f..96dc0f9424591a011b26c067452c0175f77252e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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.
@@ -9,6 +9,7 @@
 #define CNID_DBD_DB_PARAM_H 1
 
 #include <sys/param.h>
+#include <sys/cdefs.h>
 
 
 struct db_param {
index d166d26cb84e9def13a7e84f4263ab972cd2448c..802dad04915de6f6451d9c42e0d6ff9b2055dfc2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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"
index cf72a476c054dd3cdb6907b6306d9189d600365e..08e62c11ed638a1fb38061f1051854f6f3c336b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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>
 
index f08ed64e822cd55e3113eb66ce6ef7005e83d96e..87b2e51f39005022787afd37785ebe35c09345f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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"
index 5c25ce8c8e1dffa15706595627f46b142baad7d5..4a6b49718d5540675679f81b12f2819eea60b64f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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>
 
index 8d113c463146fc07c1ceabad4c0675384d9bc3cd..ac55749398ba04fed92c4043f416cad6ac11fa45 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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>
 
index 54afab6b8d6fded0c7c16d603802619cac4ef416..8f04d4ce9e4fbbfa1c6ec3b553515f5c072a6566 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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"
 
index ef68fcaf863658e0cb2f8fa7c21caf388b027d1e..12698a60e7928053d0bcb730c914cc3f33cacbc9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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.
@@ -8,11 +8,8 @@
 #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
index f3955daa24738ba977e977a3b3b93f51eecf8933..149a837f8211d22bcc7fda1fea80861c3e1f133c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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 */
@@ -27,6 +25,7 @@
 #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>
@@ -220,6 +219,7 @@ int main(int argc, char *argv[])
         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);
@@ -228,6 +228,7 @@ int main(int argc, char *argv[])
             exit(1);
         }
     }
+#endif
     LOG(log_info, logtype_cnid, "Startup, DB dir %s", dir);
 
     sv.sa_handler = sig_exit;
@@ -273,7 +274,9 @@ int main(int argc, char *argv[])
     if (dbif_close() < 0)
         err++;
 
+#ifndef SOLARIS /* FIXME */
     flock(lockfd, LOCK_UN);
+#endif
     close(lockfd);
     
     if (err) 
index 9671e482f83a83be05dfed5767f284923946846e..25951ec2418394759a0450f366edfcae775cd805 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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>
index eeb2b2c5f352c7ca51fa4f3cce0f8ecf17db6e44..03962a77ac607672a148377a90b011efc148c202 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $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.
@@ -17,5 +17,23 @@ extern int      usockfd_create  __P((char *, mode_t, int));
 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 */