comparison recpt1/recpt1.c @ 84:1b61fd7c6fde

should just shutdown when write() fails.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 13 Jan 2010 17:14:43 +0900
parents 6e3bb2c0c5b6
children 28ba9315a30c
comparison
equal deleted inserted replaced
83:b8032e8099de 84:1b61fd7c6fde
363 } 363 }
364 364
365 free(qbuf); 365 free(qbuf);
366 366
367 /* normal exit */ 367 /* normal exit */
368 if(f_exit && !p_queue->num_used && !file_err) { 368 if((f_exit && !p_queue->num_used) || file_err) {
369 369
370 buf = sbuf; /* default */ 370 buf = sbuf; /* default */
371 371
372 if(use_b25) { 372 if(use_b25) {
373 code = b25_finish(dec, &sbuf, &dbuf); 373 code = b25_finish(dec, &sbuf, &dbuf);
375 fprintf(stderr, "b25_finish failed\n"); 375 fprintf(stderr, "b25_finish failed\n");
376 else 376 else
377 buf = dbuf; 377 buf = dbuf;
378 } 378 }
379 379
380 if(!fileless) { 380 if(!fileless && !file_err) {
381 wc = write(wfd, buf.data, buf.size); 381 wc = write(wfd, buf.data, buf.size);
382 if(wc < 0) { 382 if(wc < 0) {
383 perror("write"); 383 perror("write");
384 file_err = 1; 384 file_err = 1;
385 pthread_kill(signal_thread, 385 pthread_kill(signal_thread,