diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-01-05 22:51:37 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-01-05 22:51:37 +0000 |
commit | 19d9fcbda8637099854f2d8147b402b4420d19f5 (patch) | |
tree | 993f0ebc9045bd893cd3039d0ae6277ee5806c05 /polyp/polyplib-context.c | |
parent | 2f74bb9d437fc165695e1d4bb7516ca979962a49 (diff) |
Port to Windows. This is mostly glue layers for the poor POSIX support
on Windows. A few notes
* Only sockets behave somewhat like file descriptors in UNIX.
* There are no fixed paths. Closes thing is environment variables that point
to system directories. We also figure out where the binary/dll is
located and use that as configuration directory.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@418 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/polyplib-context.c')
-rw-r--r-- | polyp/polyplib-context.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/polyp/polyplib-context.c b/polyp/polyplib-context.c index 1b9d7de6..da91995b 100644 --- a/polyp/polyplib-context.c +++ b/polyp/polyplib-context.c @@ -32,6 +32,7 @@ #include <sys/stat.h> #include <errno.h> #include <signal.h> +#include <limits.h> #ifdef HAVE_SYS_WAIT_H #include <sys/wait.h> @@ -44,6 +45,13 @@ #include <netdb.h> #endif +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> +#define ETIMEDOUT WSAETIMEDOUT +#define ECONNREFUSED WSAECONNREFUSED +#define EHOSTUNREACH WSAEHOSTUNREACH +#endif + #include "polyplib-internal.h" #include "polyplib-context.h" #include "native-common.h" @@ -382,6 +390,8 @@ finish: static void on_connection(struct pa_socket_client *client, struct pa_iochannel*io, void *userdata); +#ifndef OS_IS_WIN32 + static int context_connect_spawn(struct pa_context *c) { pid_t pid; int status, r; @@ -495,6 +505,8 @@ fail: return -1; } +#endif /* OS_IS_WIN32 */ + static int try_next_connection(struct pa_context *c) { char *u = NULL; int r = -1; @@ -509,10 +521,12 @@ static int try_next_connection(struct pa_context *c) { if (!u) { +#ifndef OS_IS_WIN32 if (c->do_autospawn) { r = context_connect_spawn(c); goto finish; } +#endif pa_context_fail(c, PA_ERROR_CONNECTIONREFUSED); goto finish; |