summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
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");
+}