summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-07-07 00:22:46 +0000
committerLennart Poettering <lennart@poettering.net>2004-07-07 00:22:46 +0000
commite8d1185c4221fef9d712c1f375d8e592721b6943 (patch)
tree1fa6e0c9fb8543520f6223cc6fa23604c5cbccde /src/util.c
parentf8cbde54dab2783e2c6ba699dfaee9ef51b1e098 (diff)
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
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c15
1 files changed, 14 insertions, 1 deletions
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 <signal.h>
#include <errno.h>
#include <assert.h>
#include <string.h>
@@ -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");
+}