25 #include "dbus-internals.h"
26 #include "dbus-connection-internal.h"
27 #include "dbus-transport-unix.h"
28 #include "dbus-transport-socket.h"
29 #include "dbus-transport-protected.h"
30 #include "dbus-watch.h"
31 #include "dbus-sysdeps-unix.h"
62 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
85 _DBUS_ASSERT_ERROR_IS_SET (error);
89 _dbus_verbose (
"Successfully connected to unix socket %s\n",
93 if (transport ==
NULL)
118 DBusTransportOpenResult
128 if (strcmp (method,
"unix") == 0)
137 "cannot use the \"tmpdir\" option for an address to connect to, only in an address to listen on");
138 return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
141 if (path ==
NULL &&
abstract ==
NULL)
146 return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
149 if (path !=
NULL &&
abstract !=
NULL)
152 "can't specify both \"path\" and \"abstract\" options in an address");
153 return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
162 if (*transport_p ==
NULL)
164 _DBUS_ASSERT_ERROR_IS_SET (error);
165 return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
169 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
170 return DBUS_TRANSPORT_OPEN_OK;
173 #ifdef DBUS_ENABLE_LAUNCHD
174 else if (strcmp (method,
"launchd") == 0)
178 const char *launchd_socket;
184 _DBUS_SET_OOM (error);
188 if (launchd_env_var ==
NULL)
191 return DBUS_TRANSPORT_OPEN_BAD_ADDRESS;
199 return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
205 "launchd's env var %s does not exist", launchd_env_var);
208 return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
214 if (*transport_p ==
NULL)
216 _DBUS_ASSERT_ERROR_IS_SET (error);
217 return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
221 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
222 return DBUS_TRANSPORT_OPEN_OK;
228 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
229 return DBUS_TRANSPORT_OPEN_NOT_HANDLED;