]> code.delx.au - pulseaudio/blobdiff - src/polyp/context.c
* split pa_cstrerror() into its own file polypcore/core-error.[ch]
[pulseaudio] / src / polyp / context.c
index c9a65847765d218524a645e200a3d3bd0bb2ee27..68fb4bf3e091564234294d1022a599f06a4c642c 100644 (file)
@@ -47,7 +47,9 @@
 
 #include "../polypcore/winsock.h"
 
+#include <polypcore/core-error.h>
 #include <polyp/version.h>
+#include <polyp/xmalloc.h>
 
 #include <polypcore/native-common.h>
 #include <polypcore/pdispatch.h>
@@ -55,8 +57,7 @@
 #include <polypcore/dynarray.h>
 #include <polypcore/socket-client.h>
 #include <polypcore/pstream-util.h>
-#include <polypcore/util.h>
-#include <polypcore/xmalloc.h>
+#include <polypcore/core-util.h>
 #include <polypcore/log.h>
 #include <polypcore/socket-util.h>
 
@@ -142,13 +143,6 @@ pa_context *pa_context_new(pa_mainloop_api *mainloop, const char *name) {
 #endif
     pa_client_conf_env(c->conf);
 
-#ifdef OS_IS_WIN32
-    {
-        WSADATA data;
-        WSAStartup(MAKEWORD(2, 0), &data);
-    }
-#endif
-    
     return c;
 }
 
@@ -187,10 +181,6 @@ static void context_free(pa_context *c) {
     pa_xfree(c->name);
     pa_xfree(c->server);
     pa_xfree(c);
-
-#ifdef OS_IS_WIN32
-    WSACleanup();
-#endif
 }
 
 pa_context* pa_context_ref(pa_context *c) {
@@ -451,7 +441,7 @@ static int context_connect_spawn(pa_context *c) {
     pa_context_ref(c);
     
     if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) {
-        pa_log(__FILE__": socketpair() failed: %s", strerror(errno));
+        pa_log(__FILE__": socketpair(): %s", pa_cstrerror(errno));
         pa_context_fail(c, PA_ERR_INTERNAL);
         goto fail;
     }
@@ -465,7 +455,7 @@ static int context_connect_spawn(pa_context *c) {
         c->spawn_api.prefork();
 
     if ((pid = fork()) < 0) {
-        pa_log(__FILE__": fork() failed: %s", strerror(errno));
+        pa_log(__FILE__": fork(): %s", pa_cstrerror(errno));
         pa_context_fail(c, PA_ERR_INTERNAL);
 
         if (c->spawn_api.postfork)
@@ -521,7 +511,7 @@ static int context_connect_spawn(pa_context *c) {
         c->spawn_api.postfork();
         
     if (r < 0) {
-        pa_log(__FILE__": waitpid() failed: %s", strerror(errno));
+        pa_log(__FILE__": waitpid(): %s", pa_cstrerror(errno));
         pa_context_fail(c, PA_ERR_INTERNAL);
         goto fail;
     } else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {