get-location: fix compilation error

If fd-passing is not enabled, we get a compiler error.
This commit is contained in:
Denis Kenzior 2011-02-23 17:33:46 -06:00
parent 8a909a6ef9
commit f214e80f2e
1 changed files with 9 additions and 0 deletions

View File

@ -37,6 +37,10 @@
#include <dbus/dbus.h>
#include <glib.h>
#ifndef DBUS_TYPE_UNIX_FD
#define DBUS_TYPE_UNIX_FD -1
#endif
static GMainLoop *event_loop;
static char *get_first_modem_path(DBusConnection *conn)
@ -213,6 +217,11 @@ int main(int argc, char *argv[])
int data_source;
int ret;
if (DBUS_TYPE_UNIX_FD < 0) {
fprintf(stderr, "File-descriptor passing not supported\n");
exit(1);
}
conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
if (!conn) {
fprintf(stderr, "Can't get on system bus\n");