[xiph-commits] r12614 - trunk/ezstream/src

moritz at svn.xiph.org moritz at svn.xiph.org
Sat Mar 3 04:42:52 PST 2007


Author: moritz
Date: 2007-03-03 04:42:50 -0800 (Sat, 03 Mar 2007)
New Revision: 12614

Modified:
   trunk/ezstream/src/ezstream.c
Log:
STDERR_FILENO -> fileno(stderr), and fix a brain'o: Systems with limited or
no signals support obviously don't have SIG_HUP/SIG_USR1 defined.


Modified: trunk/ezstream/src/ezstream.c
===================================================================
--- trunk/ezstream/src/ezstream.c	2007-03-03 00:54:47 UTC (rev 12613)
+++ trunk/ezstream/src/ezstream.c	2007-03-03 12:42:50 UTC (rev 12614)
@@ -122,7 +122,6 @@
 	char genre;
 } ID3Tag;
 
-void	sig_handler(int);
 #ifdef WIN32
 char *	basename(const char *);
 #endif
@@ -141,6 +140,9 @@
 void	usage(void);
 void	usageHelp(void);
 
+#ifdef HAVE_SIGNALS
+void	sig_handler(int);
+
 void
 sig_handler(int sig)
 {
@@ -156,6 +158,7 @@
 		break;
 	}
 }
+#endif /* HAVE_SIGNALS */
 
 #ifdef WIN32
 char *
@@ -528,7 +531,7 @@
 	*popenFlag = 0;
 	if (pezConfig->reencode) {
 		if (strlen(extension) > 0) {
-			int	stderr_fd = dup(STDERR_FILENO);
+			int	stderr_fd = dup(fileno(stderr));
 
 			pCommandString = buildCommandString(extension, fileName, pMetadata);
 			if (vFlag > 1)
@@ -544,7 +547,7 @@
 					exit(1);
 				}
 
-				dup2(fd, STDERR_FILENO);
+				dup2(fd, fileno(stderr));
 				if (fd > 2)
 					close(fd);
 			}
@@ -568,7 +571,7 @@
 			xfree(pCommandString);
 
 			if (qFlag)
-				dup2(stderr_fd, STDERR_FILENO);
+				dup2(stderr_fd, fileno(stderr));
 		} else
 			printf("%s: Error: Cannot determine file type of '%s'\n",
 			       __progname, fileName);



More information about the commits mailing list