diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-09 20:39:09 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-09 20:39:09 +0200 |
commit | d0fd30be33e3afd5f77d8dd43c613e4365dc527d (patch) | |
tree | 4e7a46c90c090e3b9b1b050875ec418c55f05fbc /tests | |
parent | 8d65a9cdd49b812fb86cfd1b33f01c27e995db36 (diff) | |
parent | b9b96fbfc66809532f4ed24d667947fa63ce68f5 (diff) | |
download | rsyslog-d0fd30be33e3afd5f77d8dd43c613e4365dc527d.tar.gz rsyslog-d0fd30be33e3afd5f77d8dd43c613e4365dc527d.tar.xz rsyslog-d0fd30be33e3afd5f77d8dd43c613e4365dc527d.zip |
Merge branch 'setrlimit' into nextmaster
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tcpflood.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/tcpflood.c b/tests/tcpflood.c index 254e9fd6..fcb68998 100644 --- a/tests/tcpflood.c +++ b/tests/tcpflood.c @@ -170,7 +170,7 @@ int sendMessages(void) else socknum = rand() % numConnections; lenBuf = sprintf(buf, "<167>Mar 1 01:00:00 172.20.245.8 tag msgnum:%8.8d:\n", i); - lenSend = send(sockArray[socknum], buf, lenBuf, MSG_NOSIGNAL); + lenSend = send(sockArray[socknum], buf, lenBuf, 0); if(lenSend != lenBuf) { printf("\r%5.5d\n", i); fflush(stdout); @@ -250,8 +250,17 @@ tcpSend(char *buf, int lenBuf) int main(int argc, char *argv[]) { int ret = 0; + struct sigaction sigAct; static char buf[1024]; + /* on Solaris, we do not HAVE MSG_NOSIGNAL, so for this reason + * we block SIGPIPE (not an issue for this program) + */ + memset(&sigAct, 0, sizeof(sigAct)); + sigemptyset(&sigAct.sa_mask); + sigAct.sa_handler = SIG_IGN; + sigaction(SIGPIPE, &sigAct, NULL); + setvbuf(stdout, buf, _IONBF, 48); if(argc != 5) { |