[polypaudio-commits] r459 - /trunk/polyp/socket-util.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Fri Jan 20 02:16:38 PST 2006
Author: ossman
Date: Fri Jan 20 11:16:37 2006
New Revision: 459
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=459&root=polypaudio&view=rev
Log:
Fix so that peer name can be determined on Windows. We do not support console
on Windows at this time so we do not have to worry about that right now.
Modified:
trunk/polyp/socket-util.c
Modified: trunk/polyp/socket-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/polyp/socket-util.c?rev=459&root=polypaudio&r1=458&r2=459&view=diff
==============================================================================
--- trunk/polyp/socket-util.c (original)
+++ trunk/polyp/socket-util.c Fri Jan 20 11:16:37 2006
@@ -69,17 +69,22 @@
assert(c && l && fd >= 0);
+#ifndef OS_IS_WIN32
if (fstat(fd, &st) < 0) {
snprintf(c, l, "Invalid client fd");
return;
}
+#endif
#ifndef OS_IS_WIN32
if (S_ISSOCK(st.st_mode)) {
+#endif
union {
struct sockaddr sa;
struct sockaddr_in in;
+#ifdef HAVE_SYS_UN_H
struct sockaddr_un un;
+#endif
} sa;
socklen_t sa_len = sizeof(sa);
@@ -95,12 +100,15 @@
ip & 0xFF,
ntohs(sa.in.sin_port));
return;
+#ifdef HAVE_SYS_UN_H
} else if (sa.sa.sa_family == AF_UNIX) {
snprintf(c, l, "UNIX socket client");
return;
+#endif
}
}
+#ifndef OS_IS_WIN32
snprintf(c, l, "Unknown network client");
return;
} else if (S_ISCHR(st.st_mode) && (fd == 0 || fd == 1)) {
More information about the pulseaudio-commits
mailing list