Skip to content

Commit

Permalink
verify write to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
millerjs committed Feb 18, 2014
1 parent 8ffa800 commit 4fb50b2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/udpipe_threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ void* recvdata(void * _args)

join_all_encryption_threads(args->c);

write(fileno(stdout), indata, block_size);
if (write(fileno(stdout), indata, block_size) < 0){
fprintf(stderr, "[udp_threads]: unable to write to stdout\n");
exit(EXIT_FAILURE);
}


buffer_cursor = 0;
crypto_cursor = 0;
Expand All @@ -311,7 +315,11 @@ void* recvdata(void * _args)

timeout_sem = 1;

write(fileno(stdout), indata, rs);
if (write(fileno(stdout), indata, rs) < 0){
fprintf(stderr, "[udp_threads]: unable to write to stdout\n");
exit(EXIT_FAILURE);
}


}

Expand Down

0 comments on commit 4fb50b2

Please sign in to comment.