diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bc5d0f4d..63fa67e61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -956,13 +956,14 @@ if (NOT LWS_HAVE_REALLOC) endif() if (UNIX) - execute_process(COMMAND uname -n OUTPUT_VARIABLE NODENAME) - # Need to chomp the \n at end of output. - string(REGEX REPLACE "[\n]+" "" NODENAME "${NODENAME}") - - if( NODENAME STREQUAL "smartos" ) - add_definitions( "-D__smartos__" ) - set(SMARTOS 1) + execute_process( COMMAND grep -c illumos /lib/ld.so.1 + OUTPUT_VARIABLE ILLUMOS ERROR_QUIET ) + # Chomp the \n at end of output. + string(REGEX REPLACE "[\n]+" "" ILLUMOS "${ILLUMOS}") + + if(NOT ${ILLUMOS} MATCHES "0") + add_definitions( "-D__illumos__" ) + set(ILLUMOS 1) endif() endif() @@ -1876,7 +1877,7 @@ if (UNIX) list(APPEND LIB_LIST m) endif() -if(SMARTOS) +if(ILLUMOS) list(APPEND LIB_LIST socket) endif() diff --git a/lib/misc/dir.c b/lib/misc/dir.c index ca5fe834d..f98f49427 100644 --- a/lib/misc/dir.c +++ b/lib/misc/dir.c @@ -106,7 +106,7 @@ lws_dir(const char *dirpath, void *user, lws_dir_callback_function cb) * files are LDOT_UNKNOWN */ -#if defined(__smartos__) +#if defined(__illumos__) struct stat s; stat(namelist[i]->d_name, &s); switch (s.st_mode) { diff --git a/lib/plat/unix/private-lib-plat-unix.h b/lib/plat/unix/private-lib-plat-unix.h index 8cf0b9d53..ca0cb1c64 100644 --- a/lib/plat/unix/private-lib-plat-unix.h +++ b/lib/plat/unix/private-lib-plat-unix.h @@ -171,6 +171,6 @@ delete_from_fd(const struct lws_context *context, int fd); * Solaris 11.X only supports POSIX 2001, MSG_NOSIGNAL appears in * POSIX 2008. */ -#if defined(__sun) && !defined(__smartos__) +#if defined(__sun) && !defined(__illumos__) #define MSG_NOSIGNAL 0 #endif