Description: Prevent a failure of "make check" when stderr is not a tty.
Author: Nicolas Boullis <nboullis@debian.org>
Applied-Upstream: 0.82, http://git.savannah.gnu.org/cgit/libcdio.git/commit/?id=2522c26ec8082be46ee4012cfac76467bb0fb350
--- a/src/cd-paranoia/cd-paranoia.c
+++ b/src/cd-paranoia/cd-paranoia.c
@@ -352,7 +352,7 @@
     sector=inpos/CD_FRAMEWORDS;
     
     if(printit==-1){
-      if(isatty(STDERR_FILENO)){
+      if(isatty(STDERR_FILENO) || (logfile != NULL)){
 	printit=1;
       }else{
 	printit=0;
@@ -528,7 +528,8 @@
 	    buffer[aheadposition+19]='>';
 	}
    
-	fprintf(stderr,buffer);
+	if(isatty(STDERR_FILENO))
+	  fprintf(stderr,buffer);
 
 	if (logfile != NULL && function==-1) {
 	  fprintf(logfile,buffer+1);
