fixed reassignment of stdout in client mode
@@ -6536,6 +6536,8 @@ while(1)
close(fd_pcapng);
else break;
}
+ if(strcmp(pcapngoutname, "-") != 0)
+ {
strncpy(newpcapngoutname, pcapngoutname, PATH_MAX);
while(stat(newpcapngoutname, &statinfo) == 0)
{
@@ -6550,6 +6552,7 @@ while(1)
errorcount++;
globalclose();
}
+ }
written = write(fd_pcapng, &serverstatus[SERVERMSG_HEAD_SIZE], (msglen -SERVERMSG_HEAD_SIZE));
if(written != (msglen -SERVERMSG_HEAD_SIZE))
{
@@ -8893,12 +8896,7 @@ if((statusout &STATUS_CLIENT) == STATUS_CLIENT)
{
if(pcapngoutname != NULL)
{
- if(strcmp(pcapngoutname, "-") == 0)
- {
- fd_pcapng = fileno(stdout);
- stdout = fopen("/dev/null", "w");
- }
- else if(strcmp(pcapngoutname, "+") == 0)
+ if(strcmp(pcapngoutname, "+") == 0)
{
fprintf(stderr, "client mode, can not send pcapng dump to clients\n");
fd_pcapng = 0;
