moonbridge
diff moonbridge.c @ 20:133a609958c4
Backed out previous changeset: Avoid "unused-result" compiler warning by storing return values in dummy variables
author | jbe |
---|---|
date | Thu Jan 29 21:54:34 2015 +0100 (2015-01-29) |
parents | be880e7c1e56 |
children | 891ceefb0876 |
line diff
1.1 --- a/moonbridge.c Thu Jan 29 21:45:58 2015 +0100 1.2 +++ b/moonbridge.c Thu Jan 29 21:54:34 2015 +0100 1.3 @@ -304,8 +304,7 @@ 1.4 if (moonbr_cond_poll) { 1.5 /* avoid race condition if signal handler is invoked right before poll() */ 1.6 char buf[1] = {0}; 1.7 - int dummy; /* avoid compiler warning */ 1.8 - dummy = write(moonbr_poll_signalfd_write, buf, 1); 1.9 + write(moonbr_poll_signalfd_write, buf, 1); 1.10 } 1.11 } else { 1.12 /* child process forwards certain signals to parent process */ 1.13 @@ -734,8 +733,7 @@ 1.14 /* Logs an error in child process while appending error string for global errno variable */ 1.15 static void moonbr_child_log_errno(const char *message) { 1.16 char errmsg[MOONBR_MAXSTRERRORLEN]; 1.17 - int dummy; /* avoid compiler warning */ 1.18 - dummy = strerror_r(errno, errmsg, MOONBR_MAXSTRERRORLEN); /* use thread-safe call in case child created threads */ 1.19 + strerror_r(errno, errmsg, MOONBR_MAXSTRERRORLEN); /* use thread-safe call in case child created threads */ 1.20 fprintf(stderr, "%s: %s\n", message, errmsg); 1.21 } 1.22 1.23 @@ -809,8 +807,7 @@ 1.24 /* Throws a Lua error message with an error string for errno appended to it */ 1.25 static void moonbr_child_lua_errno_error(lua_State *L, char *message) { 1.26 char errmsg[MOONBR_MAXSTRERRORLEN]; 1.27 - int dummy; /* avoid compiler warning */ 1.28 - dummy = strerror_r(errno, errmsg, MOONBR_MAXSTRERRORLEN); /* use thread-safe call in case child created threads */ 1.29 + strerror_r(errno, errmsg, MOONBR_MAXSTRERRORLEN); /* use thread-safe call in case child created threads */ 1.30 luaL_error(L, "%s: %s", message, errmsg); 1.31 } 1.32 1.33 @@ -2238,8 +2235,7 @@ 1.34 if (byte == EOF) { 1.35 if (ferror(file)) { 1.36 char errmsg[MOONBR_MAXSTRERRORLEN]; 1.37 - int dummy; /* avoid compiler warning */ 1.38 - dummy = strerror_r(errno, errmsg, MOONBR_MAXSTRERRORLEN); /* use thread-safe call in case child created threads */ 1.39 + strerror_r(errno, errmsg, MOONBR_MAXSTRERRORLEN); /* use thread-safe call in case child created threads */ 1.40 luaL_error(L, "%s", errmsg); 1.41 } else { 1.42 break;