*/
#define fddebug(msg...) do { char *_m = NULL; memprintf(&_m, ##msg); if (_m) write(-1, _m, strlen(_m)); free(_m); } while (0)
+/* used from everywhere just to drain results we don't want to read and which
+ * recent versions of gcc increasingly and annoyingly complain about.
+ */
+extern int shut_your_big_mouth_gcc_int;
+
+/* used from everywhere just to drain results we don't want to read and which
+ * recent versions of gcc increasingly and annoyingly complain about.
+ */
+static inline void shut_your_big_mouth_gcc(int r)
+{
+ shut_your_big_mouth_gcc_int = r;
+}
+
/* same as strstr() but case-insensitive */
const char *strnistr(const char *str1, int len_str1, const char *str2, int len_str2);
(!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))) {
chunk_printf(&trash, "appsession_refresh: cleaning up expired Session '%s' on Server %s\n",
element->sessid, element->serverid?element->serverid:"(null)");
- if (write(1, trash.str, trash.len) < 0) /* shut gcc warning */;
+ shut_your_big_mouth_gcc(write(1, trash.str, trash.len));
}
/* delete the expired element from within the hash table */
LIST_DEL(&element->hash_list);
break;
}
- if (write(1, trash.str, trash.len) < 0) /* shut gcc warning */;
+ shut_your_big_mouth_gcc(write(1, trash.str, trash.len));
}
if (s->fe->mode == PR_MODE_HTTP)
char hostname[MAX_HOSTNAME_LEN];
char localpeer[MAX_HOSTNAME_LEN];
+/* used from everywhere just to drain results we don't want to read and which
+ * recent versions of gcc increasingly and annoyingly complain about.
+ */
+int shut_your_big_mouth_gcc_int = 0;
+
/* list of the temporarily limited listeners because of lack of resource */
struct list global_listener_queue = LIST_HEAD_INIT(global_listener_queue);
struct task *global_listener_queue_task;
if (pidfd >= 0) {
char pidstr[100];
snprintf(pidstr, sizeof(pidstr), "%d\n", ret);
- if (write(pidfd, pidstr, strlen(pidstr)) < 0) /* shut gcc warning */;
+ shut_your_big_mouth_gcc(write(pidfd, pidstr, strlen(pidstr)));
}
relative_pid++; /* each child will get a different one */
}
UBOUND(max, trash.size - trash.len - 3);
trash.len += strlcpy2(trash.str + trash.len, start, max + 1);
trash.str[trash.len++] = '\n';
- if (write(1, trash.str, trash.len) < 0) /* shut gcc warning */;
+ shut_your_big_mouth_gcc(write(1, trash.str, trash.len));
}
/*
s->uniq_id, s->be->id,
objt_conn(s->si[0].end) ? (unsigned short)objt_conn(s->si[0].end)->t.sock.fd : -1,
objt_conn(s->si[1].end) ? (unsigned short)objt_conn(s->si[1].end)->t.sock.fd : -1);
- if (write(1, trash.str, trash.len) < 0) /* shut gcc warning */;
+ shut_your_big_mouth_gcc(write(1, trash.str, trash.len));
}
if (s->si[0].state == SI_ST_CLO &&
s->uniq_id, s->be->id,
objt_conn(s->si[0].end) ? (unsigned short)objt_conn(s->si[0].end)->t.sock.fd : -1,
objt_conn(s->si[1].end) ? (unsigned short)objt_conn(s->si[1].end)->t.sock.fd : -1);
- if (write(1, trash.str, trash.len) < 0) /* shut gcc warning */;
+ shut_your_big_mouth_gcc(write(1, trash.str, trash.len));
}
}
s->uniq_id, s->be->id,
objt_conn(s->si[0].end) ? (unsigned short)objt_conn(s->si[0].end)->t.sock.fd : -1,
objt_conn(s->si[1].end) ? (unsigned short)objt_conn(s->si[1].end)->t.sock.fd : -1);
- if (write(1, trash.str, trash.len) < 0) /* shut gcc warning */;
+ shut_your_big_mouth_gcc(write(1, trash.str, trash.len));
}
s->logs.t_close = tv_ms_elapsed(&s->logs.tv_accept, &now);