These commands are only added for convenience, the normal
@@ -287,6 +287,21 @@
service actually is stopped. Enabling a service sets it in
automatic mode, that is started at boot. This command cannot
set the service to manual.
+
+
The start_disabled command operates on a service
+ regardless of if it's enabled/disabled or started/stopped. It
+ does this by first enabling it (regardless of if it' enabled
+ or not), then starting it (if it's not already started) and
+ then disabling it. The result will be a disabled but started
+ service, regardless of it's earlier state. This is useful for
+ starting services temporarily during a release upgrade. The
+ difference between using start_disabled and the
+ sequence enable, start and disable is
+ that all other erlsrv commands are locked out during
+ the sequence of operations in start_disable, making the
+ operation atomic from an erlsrv user's point of
+ view.
+
diff --git a/erts/etc/win32/erlsrv/erlsrv_interactive.c b/erts/etc/win32/erlsrv/erlsrv_interactive.c
index 8910be103b..4c990a694d 100644
--- a/erts/etc/win32/erlsrv/erlsrv_interactive.c
+++ b/erts/etc/win32/erlsrv/erlsrv_interactive.c
@@ -135,7 +135,12 @@ void print_last_error(void){
fprintf(stderr,"Error: %s",mes);
LocalFree(mes);
}
-
+
+static int get_last_error(void)
+{
+ return (last_error) ? last_error : GetLastError();
+}
+
static BOOL install_service(void){
SC_HANDLE scm;
SC_HANDLE service;
@@ -508,7 +513,7 @@ int do_usage(char *arg0){
"\t[{-sn[ame] | -n[ame]} []]\n"
"\t[-d[ebugtype] [{new|reuse|console}]]\n"
"\t[-ar[gs] []]\n\n"
- "%s {start | stop | disable | enable} \n\n"
+ "%s {start | start_disabled | stop | disable | enable} \n\n"
"%s remove \n\n"
"%s rename \n\n"
"%s list []\n\n"
@@ -561,6 +566,45 @@ int do_manage(int argc,char **argv){
return 0;
}
}
+ if(!_stricmp(action,"start_disabled")){
+ if(!enable_service()){
+ fprintf(stderr,"%s: Failed to enable service %s.\n",
+ argv[0],service_name);
+ print_last_error();
+ return 1;
+ }
+ if(!start_service() && get_last_error() != ERROR_SERVICE_ALREADY_RUNNING){
+ fprintf(stderr,"%s: Failed to start service %s.\n",
+ argv[0],service_name);
+ print_last_error();
+ goto failure_starting;
+ }
+
+ if(!wait_service_trans(SERVICE_STOPPED, SERVICE_START_PENDING,
+ SERVICE_RUNNING, 60)){
+ fprintf(stderr,"%s: Failed to start service %s.\n",
+ argv[0],service_name);
+ print_last_error();
+ goto failure_starting;
+ }
+
+ if(!disable_service()){
+ fprintf(stderr,"%s: Failed to disable service %s.\n",
+ argv[0],service_name);
+ print_last_error();
+ return 1;
+ }
+ printf("%s: Service %s started.\n",
+ argv[0],service_name);
+ return 0;
+ failure_starting:
+ if(!disable_service()){
+ fprintf(stderr,"%s: Failed to disable service %s.\n",
+ argv[0],service_name);
+ print_last_error();
+ }
+ return 1;
+ }
if(!_stricmp(action,"stop")){
if(!stop_service()){
fprintf(stderr,"%s: Failed to stop service %s.\n",
@@ -1237,6 +1281,7 @@ int interactive_main(int argc, char **argv){
else if(!_stricmp(action,"list"))
res = do_list(argc,argv);
else if(!_stricmp(action,"start") ||
+ !_stricmp(action,"start_disabled") ||
!_stricmp(action,"stop") ||
!_stricmp(action,"enable") ||
!_stricmp(action,"disable"))
--
cgit v1.2.3
From d634d08090677e1f0f0d41a461c7ad8b688e1afd Mon Sep 17 00:00:00 2001
From: Patrik Nyblom
Date: Fri, 27 May 2011 16:38:14 +0200
Subject: Convert windows start_erl to take rootdir on command line
---
erts/doc/src/start_erl.xml | 29 ++++++--
erts/etc/win32/start_erl.c | 160 +++++++++++++++------------------------------
2 files changed, 75 insertions(+), 114 deletions(-)
(limited to 'erts')
diff --git a/erts/doc/src/start_erl.xml b/erts/doc/src/start_erl.xml
index 21cc901f52..6f6930af7e 100644
--- a/erts/doc/src/start_erl.xml
+++ b/erts/doc/src/start_erl.xml
@@ -69,12 +69,29 @@
program. Everything after is
interpreted as options to itself.
-reldir <release root>
- Mandatory if the environment variable is not
- specified. Tells start_erl where the root of the
- release tree is placed in the file-system
- (like <Erlang root>\\releases). The
- file is expected to be placed in
- this directory (if not otherwise specified).
+
+ Mandatory if the environment variable
+ is not specified and no
+ -rootdir option is given. Tells start_erl where the
+ root of the release tree is placed in the file-system (typically
+ <Erlang root>\\releases). The
+ file is expected to be
+ placed in this directory (if not otherwise specified). If
+ only the -rootdir option is given, the directory is
+ assumed to be <Erlang root>\\releases.
+
+ -rootdir <Erlang root directory>
+
+ Mandatory if -reldir is not given and there is
+ no in the environment. This
+ specifies the Erlang installation root directory (under
+ which the lib, releases and
+ erts-<Version> directories are placed). If only
+ -reldir (or the environment variable
+ ) is given, the Erlang root is assumed to
+ be the directory exactly one level above the release
+ directory.
+
-data <data file name>Optional, specifies another data file than start_erl.data
in the <release root>. It is specified relative to the
diff --git a/erts/etc/win32/start_erl.c b/erts/etc/win32/start_erl.c
index dcf8c8b281..c6defe7d19 100644
--- a/erts/etc/win32/start_erl.c
+++ b/erts/etc/win32/start_erl.c
@@ -24,6 +24,7 @@
#define WIN32_LEAN_AND_MEAN
#define STRICT
+#define _DEBUG
#include
#include
#include
@@ -44,6 +45,8 @@ char *progname;
#endif
#define RELEASE_SUBDIR "\\releases"
+#define ERTS_SUBDIR_PREFIX "\\erts-"
+#define BIN_SUBDIR "\\bin"
#define REGISTRY_BASE "Software\\Ericsson\\Erlang\\"
#define DEFAULT_DATAFILE "start_erl.data"
@@ -101,7 +104,8 @@ void exit_help(char *err)
printf("Usage:\n%s\n"
" [] ++\n"
" [-data ]\n"
- " [-reldir ]\n"
+ " {-rootdir | \n"
+ " -reldir }\n"
" [-bootflags ]\n"
" [-noconfig]\n", progname);
@@ -177,8 +181,9 @@ void split_commandline(void)
*/
char * unquote_optionarg(char *str, char **strp)
{
- char *newstr = (char *)malloc(strlen(str)+1); /* This one is realloc:ed later */
- int i=0, inquote=0;
+ char *newstr = (char *)malloc(strlen(str)+1); /* This one is
+ realloc:ed later */
+ int i = 0, inquote = 0;
assert(newstr);
assert(str);
@@ -223,8 +228,8 @@ char * unquote_optionarg(char *str, char **strp)
/*
- * Parses MyCommandLine and tries to fill in all the required option variables
- * (one way or another).
+ * Parses MyCommandLine and tries to fill in all the required option
+ * variables (in one way or another).
*/
void parse_commandline(void)
{
@@ -237,6 +242,11 @@ void parse_commandline(void)
*cmdline++;
if( strnicmp(cmdline, "data", 4) == 0) {
DataFileName = unquote_optionarg(cmdline+4, &cmdline);
+ } else if( strnicmp(cmdline, "rootdir", 7) == 0) {
+ RootDir = unquote_optionarg(cmdline+7, &cmdline);
+#ifdef _DEBUG
+ fprintf(stderr, "RootDir: '%s'\n", RootDir);
+#endif
} else if( strnicmp(cmdline, "reldir", 6) == 0) {
RelDir = unquote_optionarg(cmdline+6, &cmdline);
#ifdef _DEBUG
@@ -266,8 +276,8 @@ void parse_commandline(void)
* Read the data file specified and get the version and release number
* from it.
*
- * This function also construct the correct RegistryKey from the version information
- * retrieved.
+ * This function also construct the correct RegistryKey from the version
+ * information retrieved.
*/
void read_datafile(void)
{
@@ -324,88 +334,6 @@ void read_datafile(void)
}
-/*
- * Read the registry keys we need
- */
-void read_registry_keys(void)
-{
- HKEY hReg;
- ULONG lLen;
-
- /* Create the RegistryKey name */
- RegistryKey = (char *) malloc(strlen(REGISTRY_BASE) +
- strlen(Version) + 1);
- assert(RegistryKey);
- sprintf(RegistryKey, REGISTRY_BASE "%s", Version);
-
- /* We always need to find BinDir */
- if( (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- RegistryKey,
- 0,
- KEY_READ,
- &hReg)) != ERROR_SUCCESS ) {
- exit_help("Could not open registry key.");
- }
-
- /* First query size of data */
- if( (RegQueryValueEx(hReg,
- "Bindir",
- NULL,
- NULL,
- NULL,
- &lLen)) != ERROR_SUCCESS) {
- exit_help("Failed to query BinDir of release.\n");
- }
-
- /* Allocate enough space */
- BinDir = (char *)malloc(lLen+1);
- assert(BinDir);
- /* Retrieve the value */
- if( (RegQueryValueEx(hReg,
- "Bindir",
- NULL,
- NULL,
- (unsigned char *) BinDir,
- &lLen)) != ERROR_SUCCESS) {
- exit_help("Failed to query BinDir of release (2).\n");
- }
-
-#ifdef _DEBUG
- fprintf(stderr, "Bindir: '%s'\n", BinDir);
-#endif
-
- /* We also need the rootdir, in case we need to build RelDir later */
-
- /* First query size of data */
- if( (RegQueryValueEx(hReg,
- "Rootdir",
- NULL,
- NULL,
- NULL,
- &lLen)) != ERROR_SUCCESS) {
- exit_help("Failed to query RootDir of release.\n");
- }
-
- /* Allocate enough space */
- RootDir = (char *) malloc(lLen+1);
- assert(RootDir);
- /* Retrieve the value */
- if( (RegQueryValueEx(hReg,
- "Rootdir",
- NULL,
- NULL,
- (unsigned char *) RootDir,
- &lLen)) != ERROR_SUCCESS) {
- exit_help("Failed to query RootDir of release (2).\n");
- }
-
-#ifdef _DEBUG
- fprintf(stderr, "Rootdir: '%s'\n", RootDir);
-#endif
-
- RegCloseKey(hReg);
-}
-
/*
* Read the bootflags. This file contains extra command line options to erl.exe
*/
@@ -424,7 +352,8 @@ void read_bootflags(void)
exit_help("Need -reldir when -bootflags "
"filename has relative path.");
} else {
- newname = (char *)malloc(strlen(BootFlagsFile)+strlen(RelDir)+strlen(Release)+3);
+ newname = (char *)malloc(strlen(BootFlagsFile)+
+ strlen(RelDir)+strlen(Release)+3);
assert(newname);
sprintf(newname, "%s\\%s\\%s", RelDir, Release, BootFlagsFile);
free(BootFlagsFile);
@@ -436,8 +365,6 @@ void read_bootflags(void)
fprintf(stderr, "BootFlagsFile: '%s'\n", BootFlagsFile);
#endif
-
-
if( (fp=fopen(BootFlagsFile, "rb")) == NULL) {
exit_help("Could not open BootFlags file.");
}
@@ -605,32 +532,49 @@ void complete_options(void)
sz = nsz;
}
if (RelDir == NULL) {
- if(DataFileName){
- /* Needs to be absolute for this to work, but we
- can try... */
- read_datafile();
- read_registry_keys();
- } else {
- /* Impossible to find all data... */
- exit_help("Need either Release directory or an absolute "
- "datafile name.");
- }
- /* Ok, construct our own RelDir from RootDir */
- RelDir = (char *) malloc(strlen(RootDir)+strlen(RELEASE_SUBDIR)+1);
- assert(RelDir);
- sprintf(RelDir, "%s" RELEASE_SUBDIR, RootDir);
+ if (!RootDir) {
+ /* Impossible to find all data... */
+ exit_help("Need either Root directory nor Release directory.");
+ }
+ /* Ok, construct our own RelDir from RootDir */
+ RelDir = (char *) malloc(strlen(RootDir)+strlen(RELEASE_SUBDIR)+1);
+ assert(RelDir);
+ sprintf(RelDir, "%s" RELEASE_SUBDIR, RootDir);
+ read_datafile();
} else {
read_datafile();
- read_registry_keys();
}
} else {
read_datafile();
- read_registry_keys();
}
+ if( !RootDir ) {
+ /* Try to construct RootDir from RelDir */
+ char *p;
+ RootDir = malloc(strlen(RelDir)+1);
+ strcpy(RootDir,RelDir);
+ p = RootDir+strlen(RootDir)-1;
+ if (p >= RootDir && (*p == '/' || *p == '\\'))
+ --p;
+ while (p >= RootDir && *p != '/' && *p != '\\')
+ --p;
+ if (p <= RootDir) { /* Empty RootDir is also an error */
+ exit_help("Cannot determine Root directory from "
+ "Release directory.");
+ }
+ *p = '\0';
+ }
+
+
+ BinDir = (char *) malloc(strlen(RootDir)+strlen(ERTS_SUBDIR_PREFIX)+
+ strlen(Version)+strlen(BIN_SUBDIR)+1);
+ assert(BinDir);
+ sprintf(BinDir, "%s" ERTS_SUBDIR_PREFIX "%s" BIN_SUBDIR, RootDir, Version);
+
read_bootflags();
#ifdef _DEBUG
fprintf(stderr, "RelDir: '%s'\n", RelDir);
+ fprintf(stderr, "BinDir: '%s'\n", BinDir);
#endif
}
--
cgit v1.2.3
From e68fde947e540c38366d6888dfd6945efb49a880 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Holger=20Wei=C3=9F?=
Date: Tue, 7 Jun 2011 01:37:20 +0200
Subject: Detect the available CPUs on IRIX
Add support for querying the number of configured and online processors
on SGI systems running IRIX.
---
erts/lib_src/common/erl_misc_utils.c | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'erts')
diff --git a/erts/lib_src/common/erl_misc_utils.c b/erts/lib_src/common/erl_misc_utils.c
index 5dbf98c7d1..0871ece0b0 100644
--- a/erts/lib_src/common/erl_misc_utils.c
+++ b/erts/lib_src/common/erl_misc_utils.c
@@ -55,6 +55,12 @@
# ifdef HAVE_UNISTD_H
# include
# endif
+# if defined(_SC_NPROC_CONF) && !defined(_SC_NPROCESSORS_CONF)
+# define _SC_NPROCESSORS_CONF _SC_NPROC_CONF
+# endif
+# if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
+# define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
+# endif
# if (defined(NO_SYSCONF) || !defined(_SC_NPROCESSORS_CONF))
# ifdef HAVE_SYS_SYSCTL_H
# include
--
cgit v1.2.3
From 9df8a8c8ff47f69594add5ae91f76b1acf27f7fe Mon Sep 17 00:00:00 2001
From: Patrik Nyblom
Date: Tue, 7 Jun 2011 17:21:55 +0200
Subject: Spelling correction in erlsrv doc
---
erts/doc/src/erlsrv.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'erts')
diff --git a/erts/doc/src/erlsrv.xml b/erts/doc/src/erlsrv.xml
index d9f7fdd309..919caa9542 100644
--- a/erts/doc/src/erlsrv.xml
+++ b/erts/doc/src/erlsrv.xml
@@ -290,10 +290,10 @@
The start_disabled command operates on a service
regardless of if it's enabled/disabled or started/stopped. It
- does this by first enabling it (regardless of if it' enabled
+ does this by first enabling it (regardless of if it's enabled
or not), then starting it (if it's not already started) and
then disabling it. The result will be a disabled but started
- service, regardless of it's earlier state. This is useful for
+ service, regardless of its earlier state. This is useful for
starting services temporarily during a release upgrade. The
difference between using start_disabled and the
sequence enable, start and disable is
--
cgit v1.2.3
From 8722432c16fee486ebb1cf6e33bbc7cc5c9f8a0d Mon Sep 17 00:00:00 2001
From: Patrik Nyblom
Date: Thu, 9 Jun 2011 11:09:11 +0200
Subject: Remove _DEBUG from start_erl.c
---
erts/etc/win32/start_erl.c | 1 -
1 file changed, 1 deletion(-)
(limited to 'erts')
diff --git a/erts/etc/win32/start_erl.c b/erts/etc/win32/start_erl.c
index c6defe7d19..6ca7dd9b99 100644
--- a/erts/etc/win32/start_erl.c
+++ b/erts/etc/win32/start_erl.c
@@ -24,7 +24,6 @@
#define WIN32_LEAN_AND_MEAN
#define STRICT
-#define _DEBUG
#include
#include
#include
--
cgit v1.2.3
From f7da0d1019e3349c1ec9d55bd3a7d1948b92fc19 Mon Sep 17 00:00:00 2001
From: Rickard Green
Date: Mon, 13 Jun 2011 14:24:23 +0200
Subject: Do not abort emulator when buggy pthread impl return EBUSY
---
erts/emulator/beam/erl_threads.h | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
(limited to 'erts')
diff --git a/erts/emulator/beam/erl_threads.h b/erts/emulator/beam/erl_threads.h
index 8c9cace0c5..a0eda61ba5 100644
--- a/erts/emulator/beam/erl_threads.h
+++ b/erts/emulator/beam/erl_threads.h
@@ -571,8 +571,9 @@ erts_mtx_destroy(erts_mtx_t *mtx)
"Most likely a bug in pthread implementation.";
erts_send_warning_to_logger_str_nogl(warn);
}
+ else
#endif
- erts_thr_fatal_error(res, "destroy mutex");
+ erts_thr_fatal_error(res, "destroy mutex");
}
#endif
}
@@ -675,8 +676,9 @@ erts_cnd_destroy(erts_cnd_t *cnd)
"Most likely a bug in pthread implementation.";
erts_send_warning_to_logger_str_nogl(warn);
}
+ else
#endif
- erts_thr_fatal_error(res, "destroy condition variable");
+ erts_thr_fatal_error(res, "destroy condition variable");
}
#endif
}
@@ -810,8 +812,9 @@ erts_rwmtx_destroy(erts_rwmtx_t *rwmtx)
"Most likely a bug in pthread implementation.";
erts_send_warning_to_logger_str_nogl(warn);
}
+ else
#endif
- erts_thr_fatal_error(res, "destroy rwmutex");
+ erts_thr_fatal_error(res, "destroy rwmutex");
}
#endif
}
@@ -1496,8 +1499,9 @@ erts_spinlock_destroy(erts_spinlock_t *lock)
"Most likely a bug in pthread implementation.";
erts_send_warning_to_logger_str_nogl(warn);
}
+ else
#endif
- erts_thr_fatal_error(res, "destroy rwlock");
+ erts_thr_fatal_error(res, "destroy rwlock");
}
#else
(void)lock;
@@ -1614,8 +1618,9 @@ erts_rwlock_destroy(erts_rwlock_t *lock)
"Most likely a bug in pthread implementation.";
erts_send_warning_to_logger_str_nogl(warn);
}
+ else
#endif
- erts_thr_fatal_error(res, "destroy rwlock");
+ erts_thr_fatal_error(res, "destroy rwlock");
}
#else
(void)lock;
--
cgit v1.2.3
From 4f66e1a8f193c41d7de62011afde4803ba8f09f1 Mon Sep 17 00:00:00 2001
From: Patrik Nyblom
Date: Wed, 15 Jun 2011 14:46:07 +0200
Subject: Move erts_sys_env_init() to erts_sys_pre_init()
---
erts/emulator/sys/win32/sys.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
(limited to 'erts')
diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c
index a2159d063c..76db355a9c 100644
--- a/erts/emulator/sys/win32/sys.c
+++ b/erts/emulator/sys/win32/sys.c
@@ -3282,6 +3282,7 @@ erts_sys_pre_init(void)
}
#endif
erts_smp_atomic_init(&sys_misc_mem_sz, 0);
+ erts_sys_env_init();
}
void noinherit_std_handle(DWORD type)
@@ -3297,8 +3298,6 @@ void erl_sys_init(void)
{
HANDLE handle;
- erts_sys_env_init();
-
noinherit_std_handle(STD_OUTPUT_HANDLE);
noinherit_std_handle(STD_INPUT_HANDLE);
noinherit_std_handle(STD_ERROR_HANDLE);
--
cgit v1.2.3
From 604967b4c184249d8604f327bb4e683e2c453de8 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Wed, 6 Jul 2011 16:58:04 +0200
Subject: Move init of smp rw mutex from init to sys_args to make sure that it
is initialized before the first erts_sys_getenv call
---
erts/emulator/sys/unix/sys.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'erts')
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index bafbbb0f6c..cc08c1d20a 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -527,7 +527,6 @@ erts_sys_pre_init(void)
void
erl_sys_init(void)
{
- erts_smp_rwmtx_init(&environ_rwmtx, "environ");
#if !DISABLE_VFORK
{
int res;
@@ -3088,6 +3087,8 @@ get_value(char* rest, char** argv, int* ip)
void
erl_sys_args(int* argc, char** argv)
{
+ erts_smp_rwmtx_init(&environ_rwmtx, "environ");
+
int i, j;
i = 1;
@@ -3151,4 +3152,5 @@ erl_sys_args(int* argc, char** argv)
argv[j++] = argv[i];
}
*argc = j;
+
}
--
cgit v1.2.3
From 32228c665506b1d84e0758c81fcb9ff3d8f8bef4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Holger=20Wei=C3=9F?=
Date: Wed, 13 Jul 2011 15:49:04 +0200
Subject: Let epmd ignore empty ERL_EPMD_ADDRESS
If the environment variable ERL_EPMD_ADDRESS is set to the empty string,
empd now behaves like it does by default when ERL_EPMD_ADDRESS is unset.
That is, in this case, epmd now listens on all available interfaces
instead of using only the loopback interface, which happened because
epmd added the loopback address to the (in this case empty) list of
addresses specified via ERL_EPMD_ADDRESS.
Also, epmd now ignores ERL_EPMD_ADDRESS if it contains only separator
characters (comma and space).
The same applies to epmd's -address option.
---
erts/epmd/src/epmd_srv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'erts')
diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c
index 5debae26b6..da575affa1 100644
--- a/erts/epmd/src/epmd_srv.c
+++ b/erts/epmd/src/epmd_srv.c
@@ -102,7 +102,8 @@ void run(EpmdVars *g)
dbg_printf(g,2,"try to initiate listening port %d", g->port);
- if (g->addresses != NULL)
+ if (g->addresses != NULL && /* String contains non-separator characters if: */
+ g->addresses[strspn(g->addresses," ,")] != '\000')
{
char *tmp;
char *token;
--
cgit v1.2.3
From 24cb9395bd869ebd288995cadbcf25db3198f200 Mon Sep 17 00:00:00 2001
From: Patrik Nyblom
Date: Wed, 13 Jul 2011 16:42:31 +0200
Subject: Correct return values from write-functions in erl_printf
---
erts/lib_src/common/erl_printf.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
(limited to 'erts')
diff --git a/erts/lib_src/common/erl_printf.c b/erts/lib_src/common/erl_printf.c
index 72d18ab6f1..6aa4569d44 100644
--- a/erts/lib_src/common/erl_printf.c
+++ b/erts/lib_src/common/erl_printf.c
@@ -108,7 +108,7 @@ write_f_add_cr(void *vfp, char* buf, size_t len)
if (PUTC(buf[i], (FILE *) vfp) == EOF)
return get_error_result();
}
- return 0;
+ return len;
}
static int
@@ -126,13 +126,14 @@ write_f(void *vfp, char* buf, size_t len)
#endif
if (FWRITE((void *) buf, sizeof(char), len, (FILE *) vfp) != len)
return get_error_result();
- return 0;
+ return len;
}
static int
write_fd(void *vfdp, char* buf, size_t len)
{
ssize_t size;
+ size_t res = len;
ASSERT(vfdp);
while (len) {
@@ -149,7 +150,7 @@ write_fd(void *vfdp, char* buf, size_t len)
len -= size;
}
- return 0;
+ return res;
}
static int
@@ -160,7 +161,7 @@ write_s(void *vwbufpp, char* bufp, size_t len)
ASSERT(len > 0);
memcpy((void *) *wbufpp, (void *) bufp, len);
*wbufpp += len;
- return 0;
+ return len;
}
@@ -182,6 +183,7 @@ write_sn(void *vwsnap, char* buf, size_t len)
memcpy((void *) wsnap->buf, (void *) buf, sz);
wsnap->buf += sz;
wsnap->len -= sz;
+ return sz;
}
return 0;
}
@@ -201,7 +203,7 @@ write_ds(void *vdsbufp, char* buf, size_t len)
}
memcpy((void *) (dsbufp->str + dsbufp->str_len), (void *) buf, len);
dsbufp->str_len += len;
- return 0;
+ return len;
}
int
--
cgit v1.2.3
From 52230a417ad005711876132d144b3fe8a72d7e8e Mon Sep 17 00:00:00 2001
From: Dave Cottlehuber
Date: Thu, 11 Aug 2011 13:21:16 +1200
Subject: Fix win32 OpenSSL static linking broken in 20c9d6e
---
erts/configure.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'erts')
diff --git a/erts/configure.in b/erts/configure.in
index fac07f8b6a..ffa68cd296 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -3722,7 +3722,7 @@ case "$erl_xcomp_without_sysroot-$with_ssl" in
SSL_RUNTIME_LIBDIR="$rdir/lib"
SSL_LIBDIR="$dir/lib"
SSL_CRYPTO_LIBNAME=libeay32
- SSL_CRYPTO_LIBNAME=ssleay32
+ SSL_SSL_LIBNAME=ssleay32
elif test -f "$dir/lib/openssl.lib"; then
SSL_RUNTIME_LIBDIR="$rdir/lib"
SSL_LIBDIR="$dir/lib"
@@ -3904,7 +3904,7 @@ dnl so it is - be adoptable
elif test -f "$with_ssl/lib/libeay32.lib"; then
SSL_LIBDIR="$with_ssl/lib"
SSL_CRYPTO_LIBNAME=libeay32
- SSL_CRYPTO_LIBNAME=ssleay32
+ SSL_SSL_LIBNAME=ssleay32
else
# This probably wont work, but that's what the user said, so...
SSL_LIBDIR="$with_ssl/lib"
--
cgit v1.2.3
From 1b2cea397131a36a39b18c6ce8c6944bf11db4c7 Mon Sep 17 00:00:00 2001
From: Filipe David Manana
Date: Mon, 16 May 2011 17:00:25 +0100
Subject: Add erlang:external_size/2 BIF
This BIF's second parameter is a list of options.
Currently the only allowed option is {minor_version, Version}
where version is either 0 (default) or 1.
---
erts/doc/src/erlang.xml | 50 +++++++++++++++++++++++++++++++++++++
erts/emulator/beam/bif.tab | 2 ++
erts/emulator/beam/external.c | 49 ++++++++++++++++++++++++++++++++++++
erts/emulator/beam/external.h | 1 +
erts/emulator/test/binary_SUITE.erl | 16 ++++++++++--
5 files changed, 116 insertions(+), 2 deletions(-)
(limited to 'erts')
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index ad7a57bd73..84d4160e6a 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -1034,6 +1034,56 @@ b
exit reason killed.
+
+ erlang:external_size(Term) -> integer() >= 0
+ Calculate the maximum size for a term encoded in the Erlang
+ external term format
+
+ Term = term()
+
+
+
Calculates, without doing the encoding, the maximum byte size for
+ a term encoded in the Erlang external term format. The following
+ condition applies always:
This is equivalent to a call to: erlang:external_size(Term, [])
+
+
+
+
+ erlang:external_size(Term, [Option]) -> integer() >= 0
+ Calculate the maximum size for a term encoded in the Erlang
+ external term format
+
+ Term = term()
+ Option = {minor_version, Version}
+
+
+
Calculates, without doing the encoding, the maximum byte size for
+ a term encoded in the Erlang external term format. The following
+ condition applies always: