aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc
diff options
context:
space:
mode:
Diffstat (limited to 'erts/etc')
-rw-r--r--erts/etc/common/heart.c6
-rw-r--r--erts/etc/common/inet_gethost.c19
-rw-r--r--erts/etc/unix/to_erl.c7
3 files changed, 20 insertions, 12 deletions
diff --git a/erts/etc/common/heart.c b/erts/etc/common/heart.c
index 7a5746e630..fae4d870cc 100644
--- a/erts/etc/common/heart.c
+++ b/erts/etc/common/heart.c
@@ -685,14 +685,16 @@ do_terminate(reason)
print_error("Would reboot. Terminating.");
else {
kill_old_erlang();
- system(command);
+ /* suppress gcc warning with 'if' */
+ if(system(command));
print_error("Executed \"%s\". Terminating.",command);
}
free_env_val(command);
}
else {
kill_old_erlang();
- system((char*)&cmd[0]);
+ /* suppress gcc warning with 'if' */
+ if(system((char*)&cmd[0]));
print_error("Executed \"%s\". Terminating.",cmd);
}
}
diff --git a/erts/etc/common/inet_gethost.c b/erts/etc/common/inet_gethost.c
index 77bfd5e2bc..d25d2910b4 100644
--- a/erts/etc/common/inet_gethost.c
+++ b/erts/etc/common/inet_gethost.c
@@ -1141,14 +1141,12 @@ static Worker *pick_worker(void)
static Worker *pick_worker_greedy(AddrByte *domainbuff)
{
int i;
- int ql = 0;
int found = -1;
for (i=0; i < num_busy_workers; ++i) {
if (domaineq(busy_workers[i].domain, domainbuff)) {
if ((found < 0) || (busy_workers[i].que_size <
busy_workers[found].que_size)) {
found = i;
- ql = busy_workers[i].que_size;
}
}
}
@@ -1945,12 +1943,14 @@ static int worker_loop(void)
}
m = NULL;
#else
- write(1, reply, data_size); /* No signals expected */
+ /* expect no signals */
+ if (write(1, reply, data_size) < 0)
+ goto fail;
#endif
} /* for (;;) */
-#ifdef WIN32
fail:
+#ifdef WIN32
if (m != NULL) {
FREE(m);
}
@@ -1959,8 +1959,8 @@ static int worker_loop(void)
if (reply) {
FREE(reply);
}
- return 1;
#endif
+ return 1;
}
static int map_netdb_error(int netdb_code)
@@ -2561,7 +2561,8 @@ static void debugf(char *format, ...)
WriteFile(debug_console_allocated,buff,strlen(buff),&res,NULL);
}
#else
- write(2,buff,strlen(buff));
+ /* suppress warning with 'if' */
+ if(write(2,buff,strlen(buff)));
#endif
va_end(ap);
}
@@ -2583,7 +2584,8 @@ static void warning(char *format, ...)
WriteFile(GetStdHandle(STD_ERROR_HANDLE),buff,strlen(buff),&res,NULL);
}
#else
- write(2,buff,strlen(buff));
+ /* suppress warning with 'if' */
+ if(write(2,buff,strlen(buff)));
#endif
va_end(ap);
}
@@ -2605,7 +2607,8 @@ static void fatal(char *format, ...)
WriteFile(GetStdHandle(STD_ERROR_HANDLE),buff,strlen(buff),&res,NULL);
}
#else
- write(2,buff,strlen(buff));
+ /* suppress warning with 'if' */
+ if(write(2,buff,strlen(buff)));
#endif
va_end(ap);
#ifndef WIN32
diff --git a/erts/etc/unix/to_erl.c b/erts/etc/unix/to_erl.c
index 11fa3ff4cc..67274e67ed 100644
--- a/erts/etc/unix/to_erl.c
+++ b/erts/etc/unix/to_erl.c
@@ -352,7 +352,10 @@ int main(int argc, char **argv)
* to trigger the version handshaking between to_erl and run_erl
* at the start of every new to_erl-session.
*/
- write(wfd, "\022", 1);
+
+ if (write(wfd, "\022", 1) < 0) {
+ fprintf(stderr, "Error in writing ^R to FIFO.\n");
+ }
/*
* read and write
@@ -412,7 +415,7 @@ int main(int argc, char **argv)
if (len) {
#ifdef DEBUG
- write(1, buf, len);
+ if(write(1, buf, len));
#endif
if (write_all(wfd, buf, len) != len) {
fprintf(stderr, "Error in writing to FIFO.\n");