From e8d1185c4221fef9d712c1f375d8e592721b6943 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 7 Jul 2004 00:22:46 +0000 Subject: draining ind native protocol fixes in callback code on object destruction simple protocol git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@52 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/util.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 4ade681a..3111bd5d 100644 --- a/src/util.c +++ b/src/util.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -51,7 +52,7 @@ void pa_peer_to_string(char *c, size_t l, int fd) { ntohs(sa.in.sin_port)); return; } else if (sa.sa.sa_family == AF_LOCAL) { - snprintf(c, l, "UNIX client for %s", sa.un.sun_path); + snprintf(c, l, "UNIX socket client"); return; } @@ -208,3 +209,15 @@ int pa_unix_socket_remove_stale(const char *fn) { return 0; } + +void pa_check_for_sigpipe(void) { + struct sigaction sa; + + if (sigaction(SIGPIPE, NULL, &sa) < 0) { + fprintf(stderr, __FILE__": sigaction() failed: %s\n", strerror(errno)); + return; + } + + if (sa.sa_handler == SIG_DFL) + fprintf(stderr, "polypaudio: WARNING: SIGPIPE is not trapped. This might cause malfunction!\n"); +} -- cgit