From 1be748b2067c68c9cb4cabb813b28a51a53e9d98 Mon Sep 17 00:00:00 2001 From: moritz Date: Sat, 3 Mar 2007 12:42:50 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.xiph.org/trunk/ezstream@12614 0101bb08-14d6-0310-b084-bc0e0c8e3800 --- src/ezstream.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ezstream.c b/src/ezstream.c index cb36bb6..1f4cc83 100644 --- a/src/ezstream.c +++ b/src/ezstream.c @@ -122,7 +122,6 @@ typedef struct tag_ID3Tag { char genre; } ID3Tag; -void sig_handler(int); #ifdef WIN32 char * basename(const char *); #endif @@ -141,6 +140,9 @@ char * getProgname(const char *); void usage(void); void usageHelp(void); +#ifdef HAVE_SIGNALS +void sig_handler(int); + void sig_handler(int sig) { @@ -156,6 +158,7 @@ sig_handler(int sig) break; } } +#endif /* HAVE_SIGNALS */ #ifdef WIN32 char * @@ -528,7 +531,7 @@ openResource(shout_t *shout, const char *fileName, int *popenFlag, *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 @@ openResource(shout_t *shout, const char *fileName, int *popenFlag, exit(1); } - dup2(fd, STDERR_FILENO); + dup2(fd, fileno(stderr)); if (fd > 2) close(fd); } @@ -568,7 +571,7 @@ openResource(shout_t *shout, const char *fileName, int *popenFlag, 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);