Commit afdad04d authored by Olav Kvittem's avatar Olav Kvittem
Browse files

option setting output pipe size

parent 06802dd3
Pipeline #35587 passed with stages
in 1 minute and 16 seconds
......@@ -1371,10 +1371,12 @@ static int rec_n_print(unsigned short port, unsigned long limit)
if ( print_fd ){
if( pipe_buffer_size > 0){
print_file = fdopen( print_fd, "w+" );
if ( ! fstat( print_fd, &st) && S_ISFIFO(st.st_mode) ){ // set output buffer size
int p_size = fcntl( print_fd, F_SETPIPE_SZ, pipe_buffer_size );
if ( p_size > 0 ){
fprintf( stderr, "output pipe size : %d\n", p_size );
fprintf( print_file, "output pipe size : %d\n", p_size );
} else {
RUDEBUG1("crude: unable to set ouput pipe size %d : %s\n", pipe_buffer_size, strerror(errno));
return(-9);
......@@ -1384,7 +1386,6 @@ static int rec_n_print(unsigned short port, unsigned long limit)
return(-9);
}
}
print_file = fdopen( print_fd, "w+" );
} else {
print_file = stdout;
}
......@@ -1453,7 +1454,7 @@ static int rec_n_print(unsigned short port, unsigned long limit)
(unsigned long)ntohl(udp_ptr->tx_time_seconds),
(unsigned long)ntohl(udp_ptr->tx_time_useconds),
time1.tv_sec, time1.tv_usec, rec_bytes, received_ttl );
fflush(print_file);
// fflush(print_file);
}
if((limit != 0) && (pkt_count >= limit)){ break; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment