Current File : //usr/share/doc/dbus/api/dbus-server-launchd_8c_source.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>D-Bus: dbus-server-launchd.c Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">D-Bus
   &#160;<span id="projectnumber">1.8.20</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">dbus-server-launchd.c</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* dbus-server-launchd.c Server methods for interacting with launchd.</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2007, Tanner Lovelace &lt;lovelace@wayfarer.org&gt;</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2008, Colin Walters &lt;walters@verbum.org&gt;</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2008-2009, Benjamin Reed &lt;rangerrick@befunk.com&gt;</span>
<a name="l00005"></a>00005 <span class="comment"> * Copyright (C) 2009, Jonas Bähr &lt;jonas.baehr@web.de&gt;</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * Permission is hereby granted, free of charge, to any person</span>
<a name="l00008"></a>00008 <span class="comment"> * obtaining a copy of this software and associated documentation</span>
<a name="l00009"></a>00009 <span class="comment"> * files (the &quot;Software&quot;), to deal in the Software without</span>
<a name="l00010"></a>00010 <span class="comment"> * restriction, including without limitation the rights to use, copy,</span>
<a name="l00011"></a>00011 <span class="comment"> * modify, merge, publish, distribute, sublicense, and/or sell copies</span>
<a name="l00012"></a>00012 <span class="comment"> * of the Software, and to permit persons to whom the Software is</span>
<a name="l00013"></a>00013 <span class="comment"> * furnished to do so, subject to the following conditions:</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * The above copyright notice and this permission notice shall be</span>
<a name="l00016"></a>00016 <span class="comment"> * included in all copies or substantial portions of the Software.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span>
<a name="l00019"></a>00019 <span class="comment"> * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span>
<a name="l00020"></a>00020 <span class="comment"> * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span>
<a name="l00021"></a>00021 <span class="comment"> * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT</span>
<a name="l00022"></a>00022 <span class="comment"> * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,</span>
<a name="l00023"></a>00023 <span class="comment"> * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<a name="l00024"></a>00024 <span class="comment"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span>
<a name="l00025"></a>00025 <span class="comment"> * DEALINGS IN THE SOFTWARE.</span>
<a name="l00026"></a>00026 <span class="comment"> */</span>
<a name="l00027"></a>00027 
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;config.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;dbus-server-launchd.h&quot;</span>
<a name="l00030"></a>00030 
<a name="l00039"></a>00039 <span class="preprocessor">#ifdef DBUS_ENABLE_LAUNCHD</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#include &lt;launch.h&gt;</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;errno.h&gt;</span>
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="preprocessor">#include &quot;dbus-misc.h&quot;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &quot;dbus-server-socket.h&quot;</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 <span class="comment">/* put other private launchd functions here */</span>
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="preprocessor">#endif </span><span class="comment">/* DBUS_ENABLE_LAUNCHD */</span>
<a name="l00049"></a>00049 
<a name="l00064"></a>00064 <a class="code" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a> *
<a name="l00065"></a><a class="code" href="group__DBusServerLaunchd.html#ga5d09a40275e9a28d35ef3474875487a2">00065</a> <a class="code" href="group__DBusServerLaunchd.html#ga5d09a40275e9a28d35ef3474875487a2" title="Creates a new server from launchd.">_dbus_server_new_for_launchd</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *launchd_env_var, <a class="code" href="structDBusError.html" title="Object representing an exception.">DBusError</a> * error)
<a name="l00066"></a>00066   {
<a name="l00067"></a>00067 <span class="preprocessor">#ifdef DBUS_ENABLE_LAUNCHD</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>    <a class="code" href="structDBusServer.html" title="Internals of DBusServer object.">DBusServer</a> *server;
<a name="l00069"></a>00069     <a class="code" href="structDBusString.html">DBusString</a> address;
<a name="l00070"></a>00070     <span class="keywordtype">int</span> launchd_fd;
<a name="l00071"></a>00071     launch_data_t sockets_dict, checkin_response;
<a name="l00072"></a>00072     launch_data_t checkin_request;
<a name="l00073"></a>00073     launch_data_t listening_fd_array, listening_fd;
<a name="l00074"></a>00074     launch_data_t environment_dict, environment_param;
<a name="l00075"></a>00075     <span class="keyword">const</span> <span class="keywordtype">char</span> *launchd_socket_path, *display;
<a name="l00076"></a>00076 
<a name="l00077"></a>00077     launchd_socket_path = <a class="code" href="group__DBusSysdeps.html#gab846071a4de54cb7e518654f9375313a" title="Wrapper for getenv().">_dbus_getenv</a> (launchd_env_var);
<a name="l00078"></a>00078     display = <a class="code" href="group__DBusSysdeps.html#gab846071a4de54cb7e518654f9375313a" title="Wrapper for getenv().">_dbus_getenv</a> (<span class="stringliteral">&quot;DISPLAY&quot;</span>);
<a name="l00079"></a>00079 
<a name="l00080"></a>00080     _DBUS_ASSERT_ERROR_IS_CLEAR (error);
<a name="l00081"></a>00081 
<a name="l00082"></a>00082     <span class="keywordflow">if</span> (launchd_socket_path == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> || *launchd_socket_path == <span class="charliteral">&#39;\0&#39;</span>)
<a name="l00083"></a>00083       {
<a name="l00084"></a>00084         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#ga3fa04eb600edda4afc2dd9fe2e0f8b02" title="A D-Bus bus address was malformed.">DBUS_ERROR_BAD_ADDRESS</a>,
<a name="l00085"></a>00085                         <span class="stringliteral">&quot;launchd&#39;s environment variable %s is empty, but should contain a socket path.\n&quot;</span>, launchd_env_var);
<a name="l00086"></a>00086         <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00087"></a>00087       }
<a name="l00088"></a>00088 
<a name="l00089"></a>00089     <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#ga348252317f7bb8ac43529972945830ae" title="Initializes a string.">_dbus_string_init</a> (&amp;address))
<a name="l00090"></a>00090       {
<a name="l00091"></a>00091         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#gac32eaf0b92f798307853cd4fe0cf11c2" title="There was not enough memory to complete an operation.">DBUS_ERROR_NO_MEMORY</a>, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00092"></a>00092         <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00093"></a>00093       }
<a name="l00094"></a>00094     <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#ga100c5ce0696822c5a4cfbdfaba674d96" title="Appends a nul-terminated C-style string to a DBusString.">_dbus_string_append</a> (&amp;address, <span class="stringliteral">&quot;unix:path=&quot;</span>))
<a name="l00095"></a>00095       {
<a name="l00096"></a>00096         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#gac32eaf0b92f798307853cd4fe0cf11c2" title="There was not enough memory to complete an operation.">DBUS_ERROR_NO_MEMORY</a>, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00097"></a>00097         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00098"></a>00098       }
<a name="l00099"></a>00099     <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#ga100c5ce0696822c5a4cfbdfaba674d96" title="Appends a nul-terminated C-style string to a DBusString.">_dbus_string_append</a> (&amp;address, launchd_socket_path))
<a name="l00100"></a>00100       {
<a name="l00101"></a>00101         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#gac32eaf0b92f798307853cd4fe0cf11c2" title="There was not enough memory to complete an operation.">DBUS_ERROR_NO_MEMORY</a>, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00102"></a>00102         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00103"></a>00103       }
<a name="l00104"></a>00104 
<a name="l00105"></a>00105     <span class="keywordflow">if</span> ((checkin_request = launch_data_new_string (LAUNCH_KEY_CHECKIN)) == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00106"></a>00106       {
<a name="l00107"></a>00107         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#gac32eaf0b92f798307853cd4fe0cf11c2" title="There was not enough memory to complete an operation.">DBUS_ERROR_NO_MEMORY</a>,
<a name="l00108"></a>00108                         <span class="stringliteral">&quot;launch_data_new_string(\&quot;%s\&quot;) Unable to create string.\n&quot;</span>,
<a name="l00109"></a>00109                         LAUNCH_KEY_CHECKIN);
<a name="l00110"></a>00110         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00111"></a>00111       }
<a name="l00112"></a>00112 
<a name="l00113"></a>00113     <span class="keywordflow">if</span> ((checkin_response = launch_msg (checkin_request)) == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00114"></a>00114       {
<a name="l00115"></a>00115         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#ga445d7ad73da94c796ef441df2dcc3cc8" title="Something went wrong reading or writing to a socket, for example.">DBUS_ERROR_IO_ERROR</a>,
<a name="l00116"></a>00116                         <span class="stringliteral">&quot;launch_msg(\&quot;%s\&quot;) IPC failure: %s\n&quot;</span>,
<a name="l00117"></a>00117                         LAUNCH_KEY_CHECKIN, strerror (errno));
<a name="l00118"></a>00118         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00119"></a>00119       }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121     <span class="keywordflow">if</span> (LAUNCH_DATA_ERRNO == launch_data_get_type (checkin_response))
<a name="l00122"></a>00122       {
<a name="l00123"></a>00123         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#gabb62fd6340d0787fbd56ff8dd2f326c7" title="A generic error; &quot;something went wrong&quot; - see the error message for more.">DBUS_ERROR_FAILED</a>, <span class="stringliteral">&quot;Check-in failed: %s\n&quot;</span>,
<a name="l00124"></a>00124                         strerror (launch_data_get_errno (checkin_response)));
<a name="l00125"></a>00125         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00126"></a>00126       }
<a name="l00127"></a>00127 
<a name="l00128"></a>00128     sockets_dict =
<a name="l00129"></a>00129       launch_data_dict_lookup (checkin_response, LAUNCH_JOBKEY_SOCKETS);
<a name="l00130"></a>00130     <span class="keywordflow">if</span> (<a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> == sockets_dict)
<a name="l00131"></a>00131       {
<a name="l00132"></a>00132         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#ga445d7ad73da94c796ef441df2dcc3cc8" title="Something went wrong reading or writing to a socket, for example.">DBUS_ERROR_IO_ERROR</a>,
<a name="l00133"></a>00133                         <span class="stringliteral">&quot;No sockets found to answer requests on!\n&quot;</span>);
<a name="l00134"></a>00134         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00135"></a>00135       }
<a name="l00136"></a>00136 
<a name="l00137"></a>00137     listening_fd_array =
<a name="l00138"></a>00138       launch_data_dict_lookup (sockets_dict, <span class="stringliteral">&quot;unix_domain_listener&quot;</span>);
<a name="l00139"></a>00139     <span class="keywordflow">if</span> (<a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> == listening_fd_array)
<a name="l00140"></a>00140       {
<a name="l00141"></a>00141         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#ga445d7ad73da94c796ef441df2dcc3cc8" title="Something went wrong reading or writing to a socket, for example.">DBUS_ERROR_IO_ERROR</a>,
<a name="l00142"></a>00142                         <span class="stringliteral">&quot;No known sockets found to answer requests on!\n&quot;</span>);
<a name="l00143"></a>00143         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00144"></a>00144       }
<a name="l00145"></a>00145 
<a name="l00146"></a>00146     <span class="keywordflow">if</span> (launch_data_array_get_count (listening_fd_array) != 1)
<a name="l00147"></a>00147       {
<a name="l00148"></a>00148         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#ga7c96d165c4ebee51e939969934d18027" title="Some limited resource is exhausted.">DBUS_ERROR_LIMITS_EXCEEDED</a>,
<a name="l00149"></a>00149                         <span class="stringliteral">&quot;Expected 1 socket from launchd, got %d.\n&quot;</span>,
<a name="l00150"></a>00150                         launch_data_array_get_count (listening_fd_array));
<a name="l00151"></a>00151         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00152"></a>00152       }
<a name="l00153"></a>00153 
<a name="l00154"></a>00154     listening_fd = launch_data_array_get_index (listening_fd_array, 0);
<a name="l00155"></a>00155     launchd_fd = launch_data_get_fd (listening_fd);
<a name="l00156"></a>00156 
<a name="l00157"></a>00157     <a class="code" href="group__DBusSysdeps.html#ga21ef96952f98f23e590ebbf060fd5ca6" title="Sets the file descriptor to be close on exec.">_dbus_fd_set_close_on_exec</a> (launchd_fd);
<a name="l00158"></a>00158 
<a name="l00159"></a>00159     <span class="keywordflow">if</span> (launchd_fd &lt; 0)
<a name="l00160"></a>00160       {
<a name="l00161"></a>00161         _DBUS_ASSERT_ERROR_IS_SET (error);
<a name="l00162"></a>00162         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00163"></a>00163   <span class="keywordflow">if</span> (display == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> || *display == <span class="charliteral">&#39;\0&#39;</span>)
<a name="l00164"></a>00164     {
<a name="l00165"></a>00165       environment_dict = launch_data_dict_lookup (checkin_response, LAUNCH_JOBKEY_USERENVIRONMENTVARIABLES);
<a name="l00166"></a>00166       <span class="keywordflow">if</span> (<a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> == environment_dict)
<a name="l00167"></a>00167         {
<a name="l00168"></a>00168           <a class="code" href="group__DBusInternalsUtils.html#gabea2c16d6d3fe7c4eb5b9496fc877f84" title="Prints a warning message to stderr.">_dbus_warn</a> (<span class="stringliteral">&quot;Unable to retrieve user environment from launchd.&quot;</span>);
<a name="l00169"></a>00169         }
<a name="l00170"></a>00170       <span class="keywordflow">else</span>
<a name="l00171"></a>00171         {
<a name="l00172"></a>00172           environment_param = launch_data_dict_lookup (environment_dict, <span class="stringliteral">&quot;DISPLAY&quot;</span>);
<a name="l00173"></a>00173           <span class="keywordflow">if</span> (<a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> == environment_param)
<a name="l00174"></a>00174             {
<a name="l00175"></a>00175               <a class="code" href="group__DBusInternalsUtils.html#gabea2c16d6d3fe7c4eb5b9496fc877f84" title="Prints a warning message to stderr.">_dbus_warn</a> (<span class="stringliteral">&quot;Unable to retrieve DISPLAY from launchd.&quot;</span>);
<a name="l00176"></a>00176             }
<a name="l00177"></a>00177           <span class="keywordflow">else</span>
<a name="l00178"></a>00178             {
<a name="l00179"></a>00179               display = launch_data_get_string(environment_param);
<a name="l00180"></a>00180               <a class="code" href="group__DBusMisc.html#gac02f6b021decd9fa35697a36ea581f86" title="Wrapper for setenv().">dbus_setenv</a> (<span class="stringliteral">&quot;DISPLAY&quot;</span>, display);
<a name="l00181"></a>00181             }
<a name="l00182"></a>00182         }
<a name="l00183"></a>00183     }
<a name="l00184"></a>00184 
<a name="l00185"></a>00185       }
<a name="l00186"></a>00186 
<a name="l00187"></a>00187     server = <a class="code" href="group__DBusServerSocket.html#ga93d00891e32dbc05a33d3c69ca2ffef6" title="Creates a new server listening on the given file descriptor.">_dbus_server_new_for_socket</a> (&amp;launchd_fd, 1, &amp;address, 0);
<a name="l00188"></a>00188     <span class="keywordflow">if</span> (server == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00189"></a>00189       {
<a name="l00190"></a>00190         <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#ga72b375fab2486ee165e1cca2bd145695" title="Unable to connect to server (probably caused by ECONNREFUSED on a socket).">DBUS_ERROR_NO_SERVER</a>,
<a name="l00191"></a>00191                         <span class="stringliteral">&quot;Unable to listen on launchd fd %d.&quot;</span>, launchd_fd);
<a name="l00192"></a>00192         <span class="keywordflow">goto</span> l_failed_0;
<a name="l00193"></a>00193       }
<a name="l00194"></a>00194 
<a name="l00195"></a>00195     <a class="code" href="group__DBusString.html#ga781ca91acda49a834dce7d0ed0eef212" title="Frees a string created by _dbus_string_init().">_dbus_string_free</a> (&amp;address);
<a name="l00196"></a>00196 
<a name="l00197"></a>00197     <span class="keywordflow">return</span> server;
<a name="l00198"></a>00198 
<a name="l00199"></a>00199   l_failed_0:
<a name="l00200"></a>00200     <a class="code" href="group__DBusString.html#ga781ca91acda49a834dce7d0ed0eef212" title="Frees a string created by _dbus_string_init().">_dbus_string_free</a> (&amp;address);
<a name="l00201"></a>00201 
<a name="l00202"></a>00202     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00203"></a>00203 <span class="preprocessor">#else </span><span class="comment">/* DBUS_ENABLE_LAUNCHD */</span>
<a name="l00204"></a>00204     <a class="code" href="group__DBusErrors.html#ga89d2ad4bde21f9e0057fac07a79885e3" title="Assigns an error name and message to a DBusError.">dbus_set_error</a> (error, <a class="code" href="group__DBusProtocol.html#ga3fa04eb600edda4afc2dd9fe2e0f8b02" title="A D-Bus bus address was malformed.">DBUS_ERROR_BAD_ADDRESS</a>,
<a name="l00205"></a>00205                     <span class="stringliteral">&quot;address type &#39;launchd&#39; requested, but launchd support not compiled in&quot;</span>);
<a name="l00206"></a>00206     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00207"></a>00207 <span class="preprocessor">#endif</span>
<a name="l00208"></a>00208 <span class="preprocessor"></span>  }
<a name="l00209"></a>00209 
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:31 for D-Bus by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>