Fix build on Haiku

Change-Id: I4a21258c2405bd6e5c539ec0206e28a316c6ce13
Reviewed-on: https://gerrit.libreoffice.org/60835
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/connectivity/Library_mysqlc.mk b/connectivity/Library_mysqlc.mk
index 3d9d915..42a10e4 100644
--- a/connectivity/Library_mysqlc.mk
+++ b/connectivity/Library_mysqlc.mk
@@ -22,8 +22,8 @@ $(eval $(call gb_Library_set_include,mysqlc,\
))

$(eval $(call gb_Library_add_libs,mysqlc,\
	$(if $(filter-out WNT,$(OS)),$(if $(filter MACOSX SOLARIS,$(OS)),-lz -lm,\
	-rdynamic -lz -lcrypt -lm)) \
	$(if $(filter-out WNT,$(OS)),$(if $(filter HAIKU MACOSX SOLARIS,$(OS)),\
	-lz -lm,-rdynamic -lz -lcrypt -lm)) \
	$(if $(filter LINUX,$(OS)),-lpthread -ldl,) \
))

diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx
index 3af20aa..c38ab15 100644
--- a/sal/osl/unx/pipe.cxx
+++ b/sal/osl/unx/pipe.cxx
@@ -51,7 +51,9 @@ static struct
    { EPROTOTYPE,      osl_Pipe_E_NoProtocol        },  /* Protocol wrong type for socket */
    { ENOPROTOOPT,     osl_Pipe_E_NoProtocol        },  /* Protocol not available */
    { EPROTONOSUPPORT, osl_Pipe_E_NoProtocol        },  /* Protocol not supported */
#ifdef ESOCKTNOSUPPORT
    { ESOCKTNOSUPPORT, osl_Pipe_E_NoProtocol        },  /* Socket type not supported */
#endif
    { EPFNOSUPPORT,    osl_Pipe_E_NoProtocol        },  /* Protocol family not supported */
    { EAFNOSUPPORT,    osl_Pipe_E_NoProtocol        },  /* Address family not supported by */
                                                        /* protocol family */
diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx
index 698de98..e4a70b5 100644
--- a/sal/osl/unx/socket.cxx
+++ b/sal/osl/unx/socket.cxx
@@ -212,7 +212,9 @@ static const struct
    { EPROTOTYPE,      osl_Socket_E_Prototype         }, /* Protocol wrong type for socket */
    { ENOPROTOOPT,     osl_Socket_E_NoProtocol        }, /* Protocol not available */
    { EPROTONOSUPPORT, osl_Socket_E_ProtocolNoSupport }, /* Protocol not supported */
#ifdef ESOCKTNOSUPPORT
    { ESOCKTNOSUPPORT, osl_Socket_E_TypeNoSupport     }, /* Socket type not supported */
#endif
    { EOPNOTSUPP,      osl_Socket_E_OpNotSupport      }, /* Operation not supported on socket */
    { EPFNOSUPPORT,    osl_Socket_E_PfNoSupport       }, /* Protocol family not supported */
    { EAFNOSUPPORT,    osl_Socket_E_AfNoSupport       }, /* Address family not supported by
@@ -229,7 +231,9 @@ static const struct
    { EISCONN,         osl_Socket_E_IsConnected       }, /* Socket is already connected */
    { ENOTCONN,        osl_Socket_E_NotConnected      }, /* Socket is not connected */
    { ESHUTDOWN,       osl_Socket_E_Shutdown          }, /* Can't send after socket shutdown */
#ifdef ETOOMANYREFS
    { ETOOMANYREFS,    osl_Socket_E_TooManyRefs       }, /* Too many references: can't splice */
#endif
    { ETIMEDOUT,       osl_Socket_E_TimedOut          }, /* Connection timed out */
    { ECONNREFUSED,    osl_Socket_E_ConnRefused       }, /* Connection refused */
    { EHOSTDOWN,       osl_Socket_E_HostDown          }, /* Host is down */
diff --git a/sal/osl/unx/system.hxx b/sal/osl/unx/system.hxx
index 6a92f29..57c4180 100644
--- a/sal/osl/unx/system.hxx
+++ b/sal/osl/unx/system.hxx
@@ -107,8 +107,6 @@
#       define ETIME ETIMEDOUT
#   endif
#   define SIGIOT SIGABRT
#   define ESOCKTNOSUPPORT ENOTSUP
#   define ETOOMANYREFS EOPNOTSUPP
#   define SOCK_RDM 0
//  hack: Haiku defines SOL_SOCKET as -1, but this makes GCC complain about
//  narrowing conversion
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index ea48309..c3cccab 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -445,8 +445,10 @@ std::string UnixErrnoString(int nErrno)
            return "EACCES";
        case EFAULT:
            return "EFAULT";
#ifdef ENOTBLK
        case ENOTBLK:
            return "ENOTBLK";
#endif
        case EBUSY:
            return "EBUSY";
        case EEXIST: