Changeset: 804ff28c66ef for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=804ff28c66ef
Modified Files:
common/stream/stream.c
tools/merovingian/daemon/merovingian.c
Branch: Oct2020
Log Message:
Initialize stream library before using it + properly check result of
pthread_key_create.
It returns 0 for success, error number (i.e. > 0) for failure.
diffs (28 lines):
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -73,7 +73,7 @@ static pthread_key_t tl_error_key;
static int
tl_error_init(void)
{
- if (pthread_key_create(&tl_error_key, free) < 0)
+ if (pthread_key_create(&tl_error_key, free) != 0)
return -1;
return 0;
}
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
@@ -728,6 +728,12 @@ main(int argc, char *argv[])
MERO_EXIT_CLEAN(1);
}
+ /* time to initialize the stream library */
+ if (mnstr_init(false) < 0) {
+ Mfprintf(stderr, "cannot initialize stream library\n");
+ MERO_EXIT_CLEAN(1);
+ }
+
dpcons = (struct _dpair) {
.type = MERO,
.fork_lock = PTHREAD_MUTEX_INITIALIZER,
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list