Changeset: c9c8048ea034 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9c8048ea034
Modified Files:
        cmake/monetdb-defines.cmake
        common/utils/msabaoth.c
        common/utils/msabaoth.h
        monetdb_config.h.in
Branch: oscar
Log Message:

Don't check for pid_t.
On Windows just don't use it, on other systems, it's there.
Defining it conflicts with the Python include file pyconfig.h on
Windows where it is typedef'ed.


diffs (103 lines):

diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake
--- a/cmake/monetdb-defines.cmake
+++ b/cmake/monetdb-defines.cmake
@@ -293,12 +293,6 @@ macro(monetdb_configure_sizes)
   check_type_size(double SIZEOF_DOUBLE LANGUAGE C)
   check_type_size(wchar_t SIZEOF_WCHAR_T LANGUAGE C)
   check_type_size(socklen_t HAVE_SOCKLEN_T LANGUAGE C)
-  check_type_size(pid_t SIZEOF_PID_T LANGUAGE C)
-  if(NOT HAVE_SIZEOF_PID_T)
-    # Set a default value
-    set(pid_t "int")
-    set(SIZEOF_PID_T ${CMAKE_SIZEOF_INT})
-  endif()
 
   if(INT128)
     cmake_push_check_state()
diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -674,6 +674,7 @@ msab_getMyStatus(sabdb** ret)
 
 #define MAINTENANCEFILE ".maintenance"
 
+#ifndef WIN32
 /* returns pid of the process holding the gdk lock, or 0 if that is not 
possible.
  * 'not possible' could be for a variety of reasons.
  */
@@ -704,6 +705,7 @@ MT_get_locking_pid(const char *filename)
        return pid;
 #endif
 }
+#endif
 
 static sabdb *
 msab_getSingleStatus(const char *pathbuf, const char *dbname, sabdb *next)
@@ -723,6 +725,7 @@ msab_getSingleStatus(const char *pathbuf
                return next;
 
        sdb = malloc(sizeof(sabdb));
+       *sdb = (sabdb) { 0 };
        sdb->uplog = NULL;
        sdb->uri = NULL;
        sdb->secret = NULL;
@@ -732,7 +735,6 @@ msab_getSingleStatus(const char *pathbuf
        snprintf(buf, sizeof(buf), "%s/%s", pathbuf, dbname);
        sdb->path = strdup(buf);
        sdb->dbname = sdb->path + strlen(sdb->path) - strlen(dbname);
-       sdb->pid = 0;
 
 
        /* check the state of the server by looking at its gdk lock:
@@ -778,8 +780,10 @@ msab_getSingleStatus(const char *pathbuf
                 */
                sdb->state = SABdbInactive;
        } else if (fd == -1) {
+#ifndef WIN32
                /* file is locked, so mserver is running. can we find it? */
                sdb->pid = MT_get_locking_pid(buf);
+#endif
                /* see if the database has finished starting */
                snprintf(buf, sizeof(buf), "%s/%s/%s", pathbuf, dbname, 
STARTEDFILE);
                if (stat(buf, &statbuf) == -1) {
@@ -1381,13 +1385,13 @@ msab_deserialise(sabdb **ret, char *sdb)
 
        s = malloc(sizeof(sabdb));
 
+       *s = (sabdb) { 0 };
        /* msab_freeStatus() actually relies on this trick */
        s->path = s->dbname = strdup(dbname);
        s->uri = strdup(uri);
        s->secret = NULL;
        s->locked = locked;
        s->state = (SABdbState)state;
-       s->pid = 0;
        if (strlen(scens) == 0) {
                s->scens = NULL;
        } else {
diff --git a/common/utils/msabaoth.h b/common/utils/msabaoth.h
--- a/common/utils/msabaoth.h
+++ b/common/utils/msabaoth.h
@@ -27,7 +27,9 @@ typedef enum {
 typedef struct Ssabdb {
        char *dbname;            /* database name */
        char *path;              /* path to this database */
+#ifndef WIN32
        pid_t pid;               /* pid, if known */
+#endif
        bool locked;             /* whether this database is under maintenance 
*/
        SABdbState state;        /* current database state */
        sablist* scens;          /* scenarios available for this database */
diff --git a/monetdb_config.h.in b/monetdb_config.h.in
--- a/monetdb_config.h.in
+++ b/monetdb_config.h.in
@@ -300,9 +300,6 @@
 #ifndef ssize_t
 #cmakedefine ssize_t @ssize_t@
 #endif
-#ifndef pid_t
-#cmakedefine pid_t @pid_t@
-#endif
 
 /* The size of `__int128', as computed by sizeof. */
 #cmakedefine SIZEOF___INT128 @SIZEOF___INT128@
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to