[xiph-commits] r12589 - trunk/ezstream/src
moritz at svn.xiph.org
moritz at svn.xiph.org
Wed Feb 28 05:54:01 PST 2007
Author: moritz
Date: 2007-02-28 05:53:58 -0800 (Wed, 28 Feb 2007)
New Revision: 12589
Removed:
trunk/ezstream/src/ezsignals.h
Modified:
trunk/ezstream/src/Makefile.am
trunk/ezstream/src/ezstream.c
Log:
Back out hardly used ezsignals.h.
Modified: trunk/ezstream/src/Makefile.am
===================================================================
--- trunk/ezstream/src/Makefile.am 2007-02-28 12:47:26 UTC (rev 12588)
+++ trunk/ezstream/src/Makefile.am 2007-02-28 13:53:58 UTC (rev 12589)
@@ -8,7 +8,6 @@
AM_CFLAGS = @XIPH_CFLAGS@
AM_CPPFLAGS = @XIPH_CPPFLAGS@
-EXTRA_DIST = configfile.h ezsignals.h getopt.h playlist.h strlfctns.h \
- util.h
+EXTRA_DIST = configfile.h getopt.h playlist.h strlfctns.h util.h
CLEANFILES = core *.core *~ .*~
Deleted: trunk/ezstream/src/ezsignals.h
===================================================================
--- trunk/ezstream/src/ezsignals.h 2007-02-28 12:47:26 UTC (rev 12588)
+++ trunk/ezstream/src/ezsignals.h 2007-02-28 13:53:58 UTC (rev 12589)
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2007 Moritz Grimm <gtgbr at gmx.net>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* Macros to install, suspend and restore signals */
-
-#ifndef __EZSIGNALS_H__
-#define __EZSIGNALS_H__
-
-#define SIGS_INSTALL(a, b) do { \
- unsigned int i; \
- for (i = 0; i < sizeof(a) / sizeof(int); i++) { \
- if (sigaction((a)[i], (b), NULL) == -1) { \
- printf("%s: sigaction(): %s\n", \
- __progname, strerror(errno)); \
- return (1); \
- } \
- } \
-} while (0);
-
-#define SIGS_SUSPEND(a, b) do { \
- unsigned int i; \
- sigset_t sigset; \
- sigemptyset(&sigset); \
- for (i = 0; i < sizeof(a) / sizeof(int); i++) { \
- if (sigaddset(&sigset, (a)[i]) == -1) \
- printf("%s: sigaddset(): %s\n", \
- __progname, strerror(errno)); \
- exit(1); \
- } \
- if (sigprocmask(SIG_BLOCK, &sigset, (b)) == -1) { \
- printf("%s: sigprocmask(): %s\n", __progname, \
- strerror(errno)); \
- exit(1); \
- } \
-} while (0);
-
-#define SIGS_RESTORE(a) do { \
- if (sigprocmask(SIG_SETMASK, (a), NULL) == -1) { \
- printf("%s: sigprocmask(): %s\n", __progname, \
- strerror(errno)); \
- exit(1); \
- } \
-} while (0);
-
-#endif /* __EZSIGNALS_H__ */
Modified: trunk/ezstream/src/ezstream.c
===================================================================
--- trunk/ezstream/src/ezstream.c 2007-02-28 12:47:26 UTC (rev 12588)
+++ trunk/ezstream/src/ezstream.c 2007-02-28 13:53:58 UTC (rev 12589)
@@ -58,7 +58,6 @@
# include "strlfctns.h"
#endif
#include "configfile.h"
-#include "ezsignals.h"
#include "playlist.h"
#include "util.h"
@@ -817,6 +816,7 @@
extern int optind;
#ifdef HAVE_SIGNALS
struct sigaction act;
+ unsigned int i;
#endif
__progname = getProgname(argv[0]);
@@ -1048,7 +1048,13 @@
# ifdef SA_RESTART
act.sa_flags = SA_RESTART;
# endif
- SIGS_INSTALL(ezstream_signals, &act);
+ for (i = 0; i < sizeof(ezstream_signals) / sizeof(int); i++) {
+ if (sigaction(ezstream_signals[i], &act, NULL) == -1) {
+ printf("%s: sigaction(): %s\n",
+ __progname, strerror(errno));
+ return (1);
+ }
+ }
#endif /* HAVE_SIGNALS */
if (qFlag) {
More information about the commits
mailing list