Merge branch 'fd-passing'
[platform/upstream/dbus.git] / dbus / dbus-server-unix.c
index 873307e..07800c8 100644 (file)
@@ -1,4 +1,4 @@
-/* -*- mode: C; c-file-style: "gnu" -*- */
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /* dbus-server-unix.c Server implementation for Unix network protocols.
  *
  * Copyright (C) 2002, 2003, 2004  Red Hat Inc.
@@ -17,7 +17,7 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
 
@@ -43,7 +43,7 @@
  * Sets error if the result is not OK.
  * 
  * @param entry an address entry
- * @param a new DBusServer, or #NULL on failure.
+ * @param server_p location to store a new DBusServer, or #NULL on failure.
  * @param error location to store rationale for failure on bad address
  * @returns the outcome
  * 
@@ -67,9 +67,9 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
           
       if (path == NULL && tmpdir == NULL && abstract == NULL)
         {
-          _dbus_server_set_bad_address(error, "unix",
-                                       "path or tmpdir or abstract",
-                                       NULL);
+          _dbus_set_bad_address(error, "unix",
+                                "path or tmpdir or abstract",
+                                NULL);
           return DBUS_SERVER_LISTEN_BAD_ADDRESS;
         }
 
@@ -77,8 +77,8 @@ _dbus_server_listen_platform_specific (DBusAddressEntry *entry,
           (path && abstract) ||
           (tmpdir && abstract))
         {
-          _dbus_server_set_bad_address(error, NULL, NULL,
-                                       "cannot specify two of \"path\" and \"tmpdir\" and \"abstract\" at the same time");
+          _dbus_set_bad_address(error, NULL, NULL,
+                                "cannot specify two of \"path\" and \"tmpdir\" and \"abstract\" at the same time");
           return DBUS_SERVER_LISTEN_BAD_ADDRESS;
         }
 
@@ -201,15 +201,14 @@ _dbus_server_new_for_domain_socket (const char     *path,
     }
   
   listen_fd = _dbus_listen_unix_socket (path, abstract, error);
-  _dbus_fd_set_close_on_exec (listen_fd);
-  
+
   if (listen_fd < 0)
     {
       _DBUS_ASSERT_ERROR_IS_SET (error);
       goto failed_1;
     }
   
-  server = _dbus_server_new_for_socket (listen_fd, &address);
+  server = _dbus_server_new_for_socket (&listen_fd, 1, &address);
   if (server == NULL)
     {
       dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);