1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-09-15 04:08:07 -04:00

Back out hardly used ezsignals.h.

git-svn-id: https://svn.xiph.org/trunk/ezstream@12589 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
moritz 2007-02-28 13:53:58 +00:00
parent 8e56ed5c07
commit 159ebfdd91
3 changed files with 9 additions and 62 deletions

View File

@ -8,7 +8,6 @@ ezstream_LDADD = @LIBOBJS@ @XIPH_LIBS@
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 *~ .*~

View File

@ -1,58 +0,0 @@
/*
* Copyright (c) 2007 Moritz Grimm <gtgbr@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__ */

View File

@ -58,7 +58,6 @@
# include "strlfctns.h"
#endif
#include "configfile.h"
#include "ezsignals.h"
#include "playlist.h"
#include "util.h"
@ -817,6 +816,7 @@ main(int argc, char *argv[])
extern int optind;
#ifdef HAVE_SIGNALS
struct sigaction act;
unsigned int i;
#endif
__progname = getProgname(argv[0]);
@ -1048,7 +1048,13 @@ main(int argc, char *argv[])
# 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) {