diff options
Diffstat (limited to 'erts/lib_src')
-rw-r--r-- | erts/lib_src/Makefile.in | 28 | ||||
-rw-r--r-- | erts/lib_src/common/erl_misc_utils.c | 10 | ||||
-rw-r--r-- | erts/lib_src/common/erl_printf_format.c | 15 | ||||
-rw-r--r-- | erts/lib_src/common/ethr_aux.c | 4 |
4 files changed, 35 insertions, 22 deletions
diff --git a/erts/lib_src/Makefile.in b/erts/lib_src/Makefile.in index ea80e74100..aed889eaef 100644 --- a/erts/lib_src/Makefile.in +++ b/erts/lib_src/Makefile.in @@ -473,31 +473,31 @@ INTERNAL_RELEASE_LIBS= \ .PHONY: release_spec release_spec: all ifneq ($(strip $(RELEASE_INCLUDES)),) - $(INSTALL_DIR) $(RELSYSDIR)/include - $(INSTALL_DIR) $(RELEASE_PATH)/usr/include - $(INSTALL_DATA) $(RELEASE_INCLUDES) $(RELSYSDIR)/include - $(INSTALL_DATA) $(RELEASE_INCLUDES) $(RELEASE_PATH)/usr/include + $(INSTALL_DIR) "$(RELSYSDIR)/include" + $(INSTALL_DIR) "$(RELEASE_PATH)/usr/include" + $(INSTALL_DATA) $(RELEASE_INCLUDES) "$(RELSYSDIR)/include" + $(INSTALL_DATA) $(RELEASE_INCLUDES) "$(RELEASE_PATH)/usr/include" endif ifneq ($(strip $(INTERNAL_RELEASE_INCLUDES)),) - $(INSTALL_DIR) $(RELSYSDIR)/include/internal - $(INSTALL_DATA) $(INTERNAL_RELEASE_INCLUDES) $(RELSYSDIR)/include/internal + $(INSTALL_DIR) "$(RELSYSDIR)/include/internal" + $(INSTALL_DATA) $(INTERNAL_RELEASE_INCLUDES) "$(RELSYSDIR)/include/internal" endif ifneq ($(strip $(INTERNAL_X_RELEASE_INCLUDE_DIRS)),) for xdir in $(INTERNAL_X_RELEASE_INCLUDE_DIRS); do \ - $(INSTALL_DIR) $(RELSYSDIR)/include/internal/$$xdir; \ + $(INSTALL_DIR) "$(RELSYSDIR)/include/internal/$$xdir"; \ $(INSTALL_DATA) $(ERTS_INCL_INT)/$$xdir/*.h \ - $(RELSYSDIR)/include/internal/$$xdir; \ + "$(RELSYSDIR)/include/internal/$$xdir"; \ done endif ifneq ($(strip $(RELEASE_LIBS)),) - $(INSTALL_DIR) $(RELSYSDIR)/lib - $(INSTALL_DIR) $(RELEASE_PATH)/usr/lib - $(INSTALL_DATA) $(RELEASE_LIBS) $(RELSYSDIR)/lib - $(INSTALL_DATA) $(RELEASE_LIBS) $(RELEASE_PATH)/usr/lib + $(INSTALL_DIR) "$(RELSYSDIR)/lib" + $(INSTALL_DIR) "$(RELEASE_PATH)/usr/lib" + $(INSTALL_DATA) $(RELEASE_LIBS) "$(RELSYSDIR)/lib" + $(INSTALL_DATA) $(RELEASE_LIBS) "$(RELEASE_PATH)/usr/lib" endif ifneq ($(strip $(INTERNAL_RELEASE_LIBS)),) - $(INSTALL_DIR) $(RELSYSDIR)/lib/internal - $(INSTALL_DATA) $(INTERNAL_RELEASE_LIBS) $(RELSYSDIR)/lib/internal + $(INSTALL_DIR) "$(RELSYSDIR)/lib/internal" + $(INSTALL_DATA) $(INTERNAL_RELEASE_LIBS) "$(RELSYSDIR)/lib/internal" endif .PHONY: docs diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c index 3b123063fa..1b49f69581 100644 --- a/erts/lib_src/common/erl_misc_utils.c +++ b/erts/lib_src/common/erl_misc_utils.c @@ -28,8 +28,6 @@ #include "erl_misc_utils.h" #if defined(__WIN32__) -#elif defined(VXWORKS) -# include <selectLib.h> #else /* UNIX */ # include <stdio.h> # include <sys/types.h> @@ -124,6 +122,12 @@ #include <sys/sysctl.h> #endif +/* Simplify include for static functions */ + +#if defined(__linux__) || defined(HAVE_KSTAT) || defined(__WIN32__) || defined(__FreeBSD__) +# define ERTS_CPU_TOPOLOGY_ENABLED (1) +#endif + static int read_topology(erts_cpu_info_t *cpuinfo); #if defined(ERTS_HAVE_MISC_UTIL_AFFINITY_MASK__) @@ -669,6 +673,7 @@ erts_unbind_from_cpu_str(char *str) } +#if defined(ERTS_CPU_TOPOLOGY_ENABLED) static int pn_cmp(const void *vx, const void *vy) { @@ -759,6 +764,7 @@ adjust_processor_nodes(erts_cpu_info_t *cpuinfo, int no_nodes) } } } +#endif #ifdef __linux__ diff --git a/erts/lib_src/common/erl_printf_format.c b/erts/lib_src/common/erl_printf_format.c index 473791dce4..fd25cce7ed 100644 --- a/erts/lib_src/common/erl_printf_format.c +++ b/erts/lib_src/common/erl_printf_format.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2005-2011. All Rights Reserved. + * Copyright Ericsson AB 2005-2012. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -457,6 +457,15 @@ static int fmt_double(fmtfn_t fn,void*arg,double val, return res; } +/* strnlen doesn't exist everywhere */ +static size_t my_strnlen(const char *s, size_t maxlen) +{ + size_t i = 0; + while (i < maxlen && s[i] != '\0') + i++; + return i; +} + int erts_printf_format(fmtfn_t fn, void* arg, char* fmt, va_list ap) { char* ptr0 = fmt; @@ -771,9 +780,7 @@ int erts_printf_format(fmtfn_t fn, void* arg, char* fmt, va_list ap) case FMTC_s: { char* str = va_arg(ap,char*); - int len = strlen(str); - if (precision >= 0 && precision < len) - len = precision; + int len = (precision >= 0) ? my_strnlen(str,precision) : strlen(str); if (width > 0 && !(fmt & FMTF_adj)) { if (width > len) BLANKS(fn, arg, width - len, count); diff --git a/erts/lib_src/common/ethr_aux.c b/erts/lib_src/common/ethr_aux.c index 521640317e..f4ff08d368 100644 --- a/erts/lib_src/common/ethr_aux.c +++ b/erts/lib_src/common/ethr_aux.c @@ -1,7 +1,7 @@ /* * %CopyrightBegin% * - * Copyright Ericsson AB 2010-2011. All Rights Reserved. + * Copyright Ericsson AB 2010-2012. All Rights Reserved. * * The contents of this file are subject to the Erlang Public License, * Version 1.1, (the "License"); you may not use this file except in @@ -40,7 +40,7 @@ #include <unistd.h> #endif -#define ERTS_TS_EV_ALLOC_DEFAULT_POOL_SIZE 100 +#define ERTS_TS_EV_ALLOC_DEFAULT_POOL_SIZE 4000 #define ERTS_TS_EV_ALLOC_POOL_SIZE 25 erts_cpu_info_t *ethr_cpu_info__; |