Changeset: ea59ed9853b8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea59ed9853b8 Branch: octbugs Log Message:
Merged with Oct2020 diffs (truncated from 796 to 300 lines): diff --git a/clients/examples/C/streamcat.c b/clients/examples/C/streamcat.c --- a/clients/examples/C/streamcat.c +++ b/clients/examples/C/streamcat.c @@ -191,8 +191,10 @@ int cmd_read(char *argv[]) } if (wrapper != NULL) s = wrapper(s, parms); - if (s == NULL) - croak(2, "Wrapper %s did not return a stream", wrapper_name); + if (s == NULL || mnstr_errnr(s)) { + char *msg = mnstr_error(s); + croak(2, "Opener %s failed: %s", opener_name, msg ? msg : "<no error message>"); + } } if (out == NULL) { @@ -300,8 +302,10 @@ int cmd_write(char *argv[]) } if (wrapper != NULL) s = wrapper(s, parms); - if (s == NULL) - croak(2, "Wrapper %s did not return a stream", wrapper_name); + if (s == NULL || mnstr_errnr(s)) { + char *msg = mnstr_error(s); + croak(2, "Opener %s failed: %s", opener_name, msg ? msg : "<no error message>"); + } } if (in == NULL) { diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -299,7 +299,12 @@ macro(monetdb_configure_sizes) check_type_size("long int" SIZEOF_LONG_INT LANGUAGE C) check_type_size(double SIZEOF_DOUBLE LANGUAGE C) check_type_size(wchar_t SIZEOF_WCHAR_T LANGUAGE C) + cmake_push_check_state() + if(WIN32) + set(CMAKE_EXTRA_INCLUDE_FILES "Ws2tcpip.h") + endif() check_type_size(socklen_t HAVE_SOCKLEN_T LANGUAGE C) + cmake_pop_check_state() if(INT128) cmake_push_check_state() diff --git a/common/stream/bz2_stream.c b/common/stream/bz2_stream.c --- a/common/stream/bz2_stream.c +++ b/common/stream/bz2_stream.c @@ -21,7 +21,7 @@ struct inner_state { int (*work)(bz_stream *strm, int flush); int (*end)(bz_stream *strm); bool eof_reached; - Bytef buf[64*1024]; + char buf[64*1024]; }; diff --git a/common/stream/iconv_stream.c b/common/stream/iconv_stream.c --- a/common/stream/iconv_stream.c +++ b/common/stream/iconv_stream.c @@ -292,8 +292,10 @@ iconv_rstream(stream *restrict ss, const if (ss->isutf8) return ss; cd = iconv_open("utf-8", charset); - if (cd == (iconv_t) -1) + if (cd == (iconv_t) -1) { + mnstr_set_open_error(name, errno, "iconv_open"); return NULL; + } s = ic_open(cd, ss, name); if (s == NULL) { iconv_close(cd); @@ -318,8 +320,10 @@ iconv_wstream(stream *restrict ss, const if (ss->isutf8) return ss; cd = iconv_open(charset, "utf-8"); - if (cd == (iconv_t) -1) + if (cd == (iconv_t) -1) { + mnstr_set_open_error(name, errno, "iconv_open"); return NULL; + } s = ic_open(cd, ss, name); if (s == NULL) { iconv_close(cd); @@ -341,7 +345,7 @@ iconv_rstream(stream *restrict ss, const strcmp(charset, "UTF8") == 0) return ss; - mnstr_set_open_error(url, 0, "ICONV support has been left out of this MonetDB"); + mnstr_set_open_error(name, 0, "ICONV support has been left out of this MonetDB"); return NULL; } @@ -356,7 +360,7 @@ iconv_wstream(stream *restrict ss, const strcmp(charset, "UTF8") == 0) return ss; - mnstr_set_open_error(url, 0, "ICONV support has been left out of this MonetDB"); + mnstr_set_open_error(name, 0, "ICONV support has been left out of this MonetDB"); return NULL; } #endif /* HAVE_ICONV */ diff --git a/common/stream/stream.c b/common/stream/stream.c --- a/common/stream/stream.c +++ b/common/stream/stream.c @@ -86,7 +86,7 @@ get_tl_error_buf(void) p = malloc(sizeof(*p)); if (p == NULL) return NULL; - *p = (struct tl_error_buf) { .msg = 0 }; + *p = (struct tl_error_buf) { .msg = {0} }; pthread_setspecific(tl_error_key, p); struct tl_error_buf *second_attempt = pthread_getspecific(tl_error_key); assert(p == second_attempt /* maybe mnstr_init has not been called? */); diff --git a/ctest/cmake/detect-bz2.cmake b/ctest/cmake/detect-bz2.cmake --- a/ctest/cmake/detect-bz2.cmake +++ b/ctest/cmake/detect-bz2.cmake @@ -20,19 +20,7 @@ if (${LINUX_DISTRO} STREQUAL "debian") variablename BZIP2_FOUND) endif() elseif (${LINUX_DISTRO} STREQUAL "ubuntu") - if(${LINUX_DISTRO_VERSION} STREQUAL "18") - assert_package_detected( - detect FALSE - legacyvariable HAVE_LIBBZ2 - variablename BZIP2_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "19") - assert_package_detected( - detect FALSE - legacyvariable HAVE_LIBBZ2 - variablename BZIP2_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "20") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "18") assert_package_detected( detect FALSE legacyvariable HAVE_LIBBZ2 diff --git a/ctest/cmake/detect-commoncrypto.cmake b/ctest/cmake/detect-commoncrypto.cmake --- a/ctest/cmake/detect-commoncrypto.cmake +++ b/ctest/cmake/detect-commoncrypto.cmake @@ -20,19 +20,7 @@ if (${LINUX_DISTRO} STREQUAL "debian") variablename COMMONCRYPTO_FOUND) endif() elseif (${LINUX_DISTRO} STREQUAL "ubuntu") - if(${LINUX_DISTRO_VERSION} STREQUAL "18") - assert_package_detected( - detect FALSE - legacyvariable HAVE_COMMONCRYPTO - variablename COMMONCRYPTO_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "19") - assert_package_detected( - detect FALSE - legacyvariable HAVE_COMMONCRYPTO - variablename COMMONCRYPTO_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "20") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "18") assert_package_detected( detect FALSE legacyvariable HAVE_COMMONCRYPTO diff --git a/ctest/cmake/detect-curl.cmake b/ctest/cmake/detect-curl.cmake --- a/ctest/cmake/detect-curl.cmake +++ b/ctest/cmake/detect-curl.cmake @@ -20,19 +20,7 @@ if (${LINUX_DISTRO} STREQUAL "debian") variablename CURL_FOUND) endif() elseif (${LINUX_DISTRO} STREQUAL "ubuntu") - if(${LINUX_DISTRO_VERSION} STREQUAL "18") - assert_package_detected( - detect FALSE - legacyvariable HAVE_CURL - variablename CURL_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "19") - assert_package_detected( - detect FALSE - legacyvariable HAVE_CURL - variablename CURL_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "20") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "18") assert_package_detected( detect FALSE legacyvariable HAVE_CURL diff --git a/ctest/cmake/detect-fits.cmake b/ctest/cmake/detect-fits.cmake --- a/ctest/cmake/detect-fits.cmake +++ b/ctest/cmake/detect-fits.cmake @@ -24,19 +24,7 @@ if (${LINUX_DISTRO} STREQUAL "debian") variablename CFITSIO_FOUND) endif() elseif (${LINUX_DISTRO} STREQUAL "ubuntu") - if(${LINUX_DISTRO_VERSION} STREQUAL "18") - assert_package_detected( - detect FALSE - legacyvariable HAVE_FITS - variablename CFITSIO_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "19") - assert_package_detected( - detect FALSE - legacyvariable HAVE_FITS - variablename CFITSIO_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "20") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "18") assert_package_detected( detect FALSE legacyvariable HAVE_FITS diff --git a/ctest/cmake/detect-gdal.cmake b/ctest/cmake/detect-gdal.cmake --- a/ctest/cmake/detect-gdal.cmake +++ b/ctest/cmake/detect-gdal.cmake @@ -20,19 +20,7 @@ if (${LINUX_DISTRO} STREQUAL "debian") variablename GDAL_FOUND) endif() elseif (${LINUX_DISTRO} STREQUAL "ubuntu") - if(${LINUX_DISTRO_VERSION} STREQUAL "18") - assert_package_detected( - detect FALSE - legacyvariable HAVE_SHP - variablename GDAL_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "19") - assert_package_detected( - detect FALSE - legacyvariable HAVE_SHP - variablename GDAL_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "20") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "18") assert_package_detected( detect FALSE legacyvariable HAVE_SHP diff --git a/ctest/cmake/detect-geos.cmake b/ctest/cmake/detect-geos.cmake --- a/ctest/cmake/detect-geos.cmake +++ b/ctest/cmake/detect-geos.cmake @@ -20,19 +20,7 @@ if (${LINUX_DISTRO} STREQUAL "debian") variablename GEOS_FOUND) endif() elseif (${LINUX_DISTRO} STREQUAL "ubuntu") - if(${LINUX_DISTRO_VERSION} STREQUAL "18") - assert_package_detected( - detect FALSE - legacyvariable HAVE_GEOM - variablename GEOS_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "19") - assert_package_detected( - detect FALSE - legacyvariable HAVE_GEOM - variablename GEOS_FOUND) - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "20") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "18") assert_package_detected( detect FALSE legacyvariable HAVE_GEOM diff --git a/ctest/cmake/detect-getaddrinfo.cmake b/ctest/cmake/detect-getaddrinfo.cmake --- a/ctest/cmake/detect-getaddrinfo.cmake +++ b/ctest/cmake/detect-getaddrinfo.cmake @@ -20,15 +20,7 @@ if (${LINUX_DISTRO} STREQUAL "debian") set(UNDETECT "1") endif() elseif (${LINUX_DISTRO} STREQUAL "ubuntu") - if(${LINUX_DISTRO_VERSION} STREQUAL "18") - set(DETECT "0") - set(UNDETECT "1") - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "19") - set(DETECT "0") - set(UNDETECT "1") - endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "20") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "18") set(DETECT "0") set(UNDETECT "1") endif() diff --git a/ctest/cmake/detect-iconv.cmake b/ctest/cmake/detect-iconv.cmake --- a/ctest/cmake/detect-iconv.cmake +++ b/ctest/cmake/detect-iconv.cmake @@ -20,24 +20,18 @@ if (${LINUX_DISTRO} STREQUAL "debian") variablename Iconv_FOUND) endif() elseif (${LINUX_DISTRO} STREQUAL "ubuntu") - if(${LINUX_DISTRO_VERSION} STREQUAL "18") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "20") assert_package_detected( - detect FALSE + detect TRUE legacyvariable HAVE_ICONV variablename Iconv_FOUND) endif() - if(${LINUX_DISTRO_VERSION} STREQUAL "19") + if(${LINUX_DISTRO_VERSION} VERSION_GREATER_EQUAL "18") assert_package_detected( detect FALSE legacyvariable HAVE_ICONV variablename Iconv_FOUND) endif() _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list