comparison src/dbusbind.c @ 111251:2dcdfeb8d47c

* dbusbind.c (Fdbus_call_method_asynchronously) (Fdbus_register_signal, Fdbus_register_method): Check, whether `dbus-registered-objects-table' is initialized. Must not be synchronized with the trunk.
author Michael Albinus <michael.albinus@gmx.de>
date Mon, 25 Oct 2010 13:46:21 +0200
parents 7e091be752b1
children 029e4783cbae 376148b31b5e
comparison
equal deleted inserted replaced
111162:bd94f8980f47 111251:2dcdfeb8d47c
1173 SDATA (service), 1173 SDATA (service),
1174 SDATA (path), 1174 SDATA (path),
1175 SDATA (interface), 1175 SDATA (interface),
1176 SDATA (method)); 1176 SDATA (method));
1177 1177
1178 /* Check dbus-registered-objects-table. */
1179 if (!HASH_TABLE_P (Vdbus_registered_objects_table))
1180 XD_SIGNAL1 (build_string ("dbus.el is not loaded"));
1181
1178 /* Open a connection to the bus. */ 1182 /* Open a connection to the bus. */
1179 connection = xd_initialize (bus); 1183 connection = xd_initialize (bus);
1180 1184
1181 /* Create the message. */ 1185 /* Create the message. */
1182 dmessage = dbus_message_new_method_call (SDATA (service), 1186 dmessage = dbus_message_new_method_call (SDATA (service),
1861 CHECK_STRING (signal); 1865 CHECK_STRING (signal);
1862 if (!FUNCTIONP (handler)) 1866 if (!FUNCTIONP (handler))
1863 wrong_type_argument (intern ("functionp"), handler); 1867 wrong_type_argument (intern ("functionp"), handler);
1864 GCPRO6 (bus, service, path, interface, signal, handler); 1868 GCPRO6 (bus, service, path, interface, signal, handler);
1865 1869
1870 /* Check dbus-registered-objects-table. */
1871 if (!HASH_TABLE_P (Vdbus_registered_objects_table))
1872 XD_SIGNAL1 (build_string ("dbus.el is not loaded"));
1873
1866 /* Retrieve unique name of service. If service is a known name, we 1874 /* Retrieve unique name of service. If service is a known name, we
1867 will register for the corresponding unique name, if any. Signals 1875 will register for the corresponding unique name, if any. Signals
1868 are sent always with the unique name as sender. Note: the unique 1876 are sent always with the unique name as sender. Note: the unique
1869 name of "org.freedesktop.DBus" is that string itself. */ 1877 name of "org.freedesktop.DBus" is that string itself. */
1870 if ((STRINGP (service)) 1878 if ((STRINGP (service))
1974 if (!FUNCTIONP (handler)) 1982 if (!FUNCTIONP (handler))
1975 wrong_type_argument (intern ("functionp"), handler); 1983 wrong_type_argument (intern ("functionp"), handler);
1976 /* TODO: We must check for a valid service name, otherwise there is 1984 /* TODO: We must check for a valid service name, otherwise there is
1977 a segmentation fault. */ 1985 a segmentation fault. */
1978 1986
1987 /* Check dbus-registered-objects-table. */
1988 if (!HASH_TABLE_P (Vdbus_registered_objects_table))
1989 XD_SIGNAL1 (build_string ("dbus.el is not loaded"));
1990
1979 /* Open a connection to the bus. */ 1991 /* Open a connection to the bus. */
1980 connection = xd_initialize (bus); 1992 connection = xd_initialize (bus);
1981 1993
1982 /* Request the known name from the bus. We can ignore the result, 1994 /* Request the known name from the bus. We can ignore the result,
1983 it is set to -1 if there is an error - kind of redundancy. */ 1995 it is set to -1 if there is an error - kind of redundancy. */