Changeset: 7637dc59c7a0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7637dc59c7a0 Modified Files: common/utils/msabaoth.c sql/backends/monet5/sql_gencode.c tools/merovingian/client/monetdb.c tools/merovingian/daemon/client.c tools/merovingian/daemon/connections.c tools/merovingian/daemon/forkmserver.c tools/merovingian/daemon/handlers.c tools/merovingian/daemon/merovingian.c tools/merovingian/daemon/multiplex-funnel.c tools/merovingian/utils/glob.c Branch: default Log Message:
Merge with Nov2019 branch. diffs (254 lines): diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c --- a/common/utils/msabaoth.c +++ b/common/utils/msabaoth.c @@ -148,7 +148,7 @@ msab_init(const char *dbfarm, const char if (_sabaoth_internal_dbname != NULL) free(_sabaoth_internal_dbname); - /* this UUID is supposed to be unique per-process, we use it lateron + /* this UUID is supposed to be unique per-process, we use it later on * to determine if a database is (started by) the current process, * since locking always succeeds for the same process */ if (_sabaoth_internal_uuid == NULL) diff --git a/sql/backends/monet5/sql_gencode.c b/sql/backends/monet5/sql_gencode.c --- a/sql/backends/monet5/sql_gencode.c +++ b/sql/backends/monet5/sql_gencode.c @@ -445,19 +445,14 @@ static int char *mal_session_uuid, *err = NULL; if (!GDKinmemory() && (err = msab_getUUID(&mal_session_uuid)) == NULL) { + str lsupervisor_session = GDKstrdup(mal_session_uuid); str rsupervisor_session = GDKstrdup(mal_session_uuid); - if (rsupervisor_session == NULL) { - free(mal_session_uuid); - return -1; - } - - str lsupervisor_session = GDKstrdup(mal_session_uuid); - if (lsupervisor_session == NULL) { - free(mal_session_uuid); + free(mal_session_uuid); + if (lsupervisor_session == NULL || rsupervisor_session == NULL) { + GDKfree(lsupervisor_session); GDKfree(rsupervisor_session); return -1; } - free(mal_session_uuid); str rworker_plan_uuid = generateUUID(); if (rworker_plan_uuid == NULL) { diff --git a/tools/merovingian/client/monetdb.c b/tools/merovingian/client/monetdb.c --- a/tools/merovingian/client/monetdb.c +++ b/tools/merovingian/client/monetdb.c @@ -506,7 +506,7 @@ globMatchDBS(int argc, char *argv[], sab /* move out of orig into w, such that we can't * get double matches in the same output list * (as side effect also avoids a double free - * lateron) */ + * later on) */ if (w == NULL) { top = w = stats; } else { @@ -737,7 +737,7 @@ command_status(int argc, char *argv[]) } } /* make this option no longer available, for easy use - * lateron */ + * later on */ argv[i] = NULL; } else { doall = 0; @@ -1043,7 +1043,7 @@ command_startstop(int argc, char *argv[] } } /* make this option no longer available, for easy use - * lateron */ + * later on */ argv[i] = NULL; } } @@ -1148,7 +1148,7 @@ command_set(int argc, char *argv[], mero } } /* make this option no longer available, for easy use - * lateron */ + * later on */ argv[i] = NULL; } else if (property[0] == '\0') { /* first non-option is property, rest is database */ @@ -1282,7 +1282,7 @@ command_get(int argc, char *argv[]) } } /* make this option no longer available, for easy use - * lateron */ + * later on */ argv[i] = NULL; } else if (property == NULL) { /* first non-option is property, rest is database */ @@ -1815,7 +1815,7 @@ main(int argc, char *argv[]) fprintf(stderr, "monetdb: cannot find a control socket, use -h and/or -p\n"); exit(1); } - /* don't confuse control_send lateron */ + /* don't confuse control_send later on */ mero_port = -1; } /* for TCP connections */ diff --git a/tools/merovingian/daemon/client.c b/tools/merovingian/daemon/client.c --- a/tools/merovingian/daemon/client.c +++ b/tools/merovingian/daemon/client.c @@ -68,7 +68,7 @@ handleClient(void *data) sabdb *top = NULL; sabdb *stat = NULL; struct sockaddr saddr; - socklen_t saddrlen = 0; + socklen_t saddrlen = (socklen_t) sizeof(saddr); err e; confkeyval *ckv, *kv; char mydoproxy; diff --git a/tools/merovingian/daemon/connections.c b/tools/merovingian/daemon/connections.c --- a/tools/merovingian/daemon/connections.c +++ b/tools/merovingian/daemon/connections.c @@ -34,7 +34,6 @@ openConnectionTCP(int *ret, bool bind_ip int sock = -1, check = 0; socklen_t length = 0; int on = 1; - int i = 0; char sport[16]; snprintf(sport, 16, "%hu", port); @@ -94,20 +93,22 @@ openConnectionTCP(int *ret, bool bind_ip return(newErr("creation of stream socket failed: %s", strerror(errno))); if (bind_ipv6) { - memset(&server_ipv6, 0, sizeof(server_ipv6)); - server_ipv6.sin6_family = AF_INET6; + server_ipv6 = (struct sockaddr_in6) { + .sin6_family = AF_INET6, + .sin6_port = htons((unsigned short) (port & 0xFFFF)), + .sin6_addr = ipv6_any_addr, + }; length = (socklen_t) sizeof(server_ipv6); - server_ipv6.sin6_port = htons((unsigned short) ((port) & 0xFFFF)); - server_ipv6.sin6_addr = ipv6_any_addr; + server = (struct sockaddr*) &server_ipv6; } else { - server_ipv4.sin_family = AF_INET; - for (i = 0; i < 8; i++) - server_ipv4.sin_zero[i] = 0; + server_ipv4 = (struct sockaddr_in) { + .sin_family = AF_INET, + .sin_port = htons((unsigned short) (port & 0xFFFF)), + .sin_addr.s_addr = htonl(INADDR_ANY), + }; length = (socklen_t) sizeof(server_ipv4); - server_ipv4.sin_port = htons((unsigned short) ((port) & 0xFFFF)); - server_ipv4.sin_addr.s_addr = htonl(INADDR_ANY); + server = (struct sockaddr*) &server_ipv4; } - server = bind_ipv6 ? (struct sockaddr*) &server_ipv6 : (struct sockaddr*) &server_ipv4; #if !defined(SOCK_CLOEXEC) && defined(HAVE_FCNTL) (void) fcntl(sock, F_SETFD, FD_CLOEXEC); diff --git a/tools/merovingian/daemon/forkmserver.c b/tools/merovingian/daemon/forkmserver.c --- a/tools/merovingian/daemon/forkmserver.c +++ b/tools/merovingian/daemon/forkmserver.c @@ -431,7 +431,7 @@ forkMserver(char *database, sabdb** stat } /* check if the vaultkey is there, otherwise abort early (value - * lateron reused when server is started) */ + * later on reused when server is started) */ snprintf(vaultkey, sizeof(vaultkey), "%s/.vaultkey", (*stats)->path); if (stat(vaultkey, &statbuf) == -1) { msab_freeStatus(stats); diff --git a/tools/merovingian/daemon/handlers.c b/tools/merovingian/daemon/handlers.c --- a/tools/merovingian/daemon/handlers.c +++ b/tools/merovingian/daemon/handlers.c @@ -114,7 +114,7 @@ void reinitialize(void) readProps(_mero_props, "."); /* check and trim the hash-algo from the passphrase for easy use - * lateron */ + * later on */ kv = findConfKey(_mero_props, "passphrase"); if (kv->val != NULL) { char *h = kv->val + 1; diff --git a/tools/merovingian/daemon/merovingian.c b/tools/merovingian/daemon/merovingian.c --- a/tools/merovingian/daemon/merovingian.c +++ b/tools/merovingian/daemon/merovingian.c @@ -101,7 +101,7 @@ typedef struct _threadlist { char *_mero_mserver = NULL; /* list of databases that we have started */ dpair _mero_topdp = NULL; -/* lock to _mero_topdp, initialised as recursive lateron */ +/* lock to _mero_topdp, initialised as recursive later on */ pthread_mutex_t _mero_topdp_lock = PTHREAD_MUTEX_INITIALIZER; /* for the logger, when set to 0, the logger terminates */ volatile int _mero_keep_logging = 1; @@ -343,7 +343,7 @@ main(int argc, char *argv[]) int socku = -1; char* host = NULL; unsigned short port = 0; - char discovery = 0; + bool discovery = false; struct stat sb; FILE *oerr = NULL; int thret; @@ -661,7 +661,7 @@ main(int argc, char *argv[]) discovery = getConfNum(_mero_props, "discovery"); /* check and trim the hash-algo from the passphrase for easy use - * lateron */ + * later on */ kv = findConfKey(_mero_props, "passphrase"); if (kv->val != NULL) { char *h = kv->val + 1; @@ -949,12 +949,12 @@ main(int argc, char *argv[]) /* open up connections */ if ((e = openConnectionTCP(&sock, use_ipv6, host, port, stdout)) == NO_ERR && (e = openConnectionUNIX(&socku, mapi_usock, 0, stdout)) == NO_ERR && - (discovery == 0 || (e = openConnectionUDP(&discsock, false, host, port)) == NO_ERR) && + (!discovery || (e = openConnectionUDP(&discsock, false, host, port)) == NO_ERR) && (e = openConnectionUNIX(&unsock, control_usock, S_IRWXO, _mero_ctlout)) == NO_ERR) { pthread_t ctid = 0; pthread_t dtid = 0; - if (discovery == 1) { + if (discovery) { _mero_broadcastsock = socket(AF_INET, SOCK_DGRAM #ifdef SOCK_CLOEXEC | SOCK_CLOEXEC diff --git a/tools/merovingian/daemon/multiplex-funnel.c b/tools/merovingian/daemon/multiplex-funnel.c --- a/tools/merovingian/daemon/multiplex-funnel.c +++ b/tools/merovingian/daemon/multiplex-funnel.c @@ -615,7 +615,7 @@ multiplexQuery(multiplex *m, char *buf, rlen += mapi_rows_affected(h); break; case Q_SCHEMA: - /* accept, just write ok lateron */ + /* accept, just write ok later on */ break; case Q_TRANS: /* just check all servers end up in the same state */ diff --git a/tools/merovingian/utils/glob.c b/tools/merovingian/utils/glob.c --- a/tools/merovingian/utils/glob.c +++ b/tools/merovingian/utils/glob.c @@ -41,7 +41,7 @@ db_glob(const char *expr, const char *ha switch (*expr) { case '*': if (!escape) { - /* store expression position for retry lateron */ + /* store expression position for retry later on */ exprmem = expr; /* skip over haystack till the next char from expr */ do { @@ -61,7 +61,7 @@ db_glob(const char *expr, const char *ha } while(1); while (*haystack != '\0' && *haystack != *expr) haystack++; - /* store match position, for retry lateron */ + /* store match position, for retry later on */ haymem = haystack + 1; if (*haystack == '\0') /* couldn't find it, so no match */ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list