]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/avahi/avahi-0.1/dbus-warn.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / avahi / avahi-0.1 / dbus-warn.patch
1 diff -Nur avahi-0.1/avahi-daemon/avahi-daemon.conf avahi-0.1.new/avahi-daemon/avahi-daemon.conf
2 --- avahi-0.1/avahi-daemon/avahi-daemon.conf    2005-08-22 05:27:09.000000000 +0800
3 +++ avahi-0.1.new/avahi-daemon/avahi-daemon.conf        2005-08-23 04:46:04.000000000 +0800
4 @@ -5,7 +5,7 @@
5  use-ipv6=no
6  check-response-ttl=no
7  use-iff-running=no
8 -enable-dbus=yes
9 +enable-dbus=warn
10  
11  [publish]
12  publish-addresses=yes
13 diff -Nur avahi-0.1/avahi-daemon/main.c avahi-0.1.new/avahi-daemon/main.c
14 --- avahi-0.1/avahi-daemon/main.c       2005-08-22 05:27:09.000000000 +0800
15 +++ avahi-0.1.new/avahi-daemon/main.c   2005-08-23 04:45:45.000000000 +0800
16 @@ -78,7 +78,10 @@
17      int daemonize;
18      int use_syslog;
19      char *config_file;
20 +#ifdef HAVE_DBUS
21      int enable_dbus;
22 +    int fail_on_missing_dbus;
23 +#endif
24      int drop_root;
25      int publish_resolv_conf;
26      char ** publish_dns_servers;
27 @@ -380,8 +383,20 @@
28                      c->server_config.check_response_ttl = is_yes(p->value);
29                  else if (strcasecmp(p->key, "use-iff-running") == 0)
30                      c->server_config.use_iff_running = is_yes(p->value);
31 -                else if (strcasecmp(p->key, "enable-dbus") == 0)
32 -                    c->enable_dbus = is_yes(p->value);
33 +#ifdef HAVE_DBUS                
34 +                else if (strcasecmp(p->key, "enable-dbus") == 0) {
35 +
36 +                    if (*(p->value) == 'w' || *(p->value) == 'W') {
37 +                        c->fail_on_missing_dbus = 0;
38 +                        c->enable_dbus = 1;
39 +                    } else if (*(p->value) == 'y' || *(p->value) == 'Y') {
40 +                        c->fail_on_missing_dbus = 1;
41 +                        c->enable_dbus = 1;
42 +                    } else
43 +                        c->enable_dbus = 0;
44 +                    
45 +                }
46 +#endif
47                  else if (strcasecmp(p->key, "drop-root") == 0)
48                      c->drop_root = is_yes(p->value);
49                  else {
50 @@ -587,8 +602,14 @@
51      
52  #ifdef HAVE_DBUS
53      if (c->enable_dbus)
54 -        if (dbus_protocol_setup(poll_api) < 0)
55 -            goto finish;
56 +        if (dbus_protocol_setup(poll_api) < 0) {
57 +
58 +            if (c->fail_on_missing_dbus)
59 +                goto finish;
60 +
61 +            avahi_log_warn("WARNING: Failed to contact D-BUS daemon, disabling D-BUS support.");
62 +            c->enable_dbus = 0;
63 +        }
64  #endif
65      
66      load_resolv_conf(c);
67 @@ -825,7 +846,10 @@
68      config.command = DAEMON_RUN;
69      config.daemonize = 0;
70      config.config_file = NULL;
71 +#ifdef HAVE_DBUS
72      config.enable_dbus = 1;
73 +    config.fail_on_missing_dbus = 1;
74 +#endif
75      config.drop_root = 1;
76      config.publish_dns_servers = NULL;
77      config.publish_resolv_conf = 0;
78 diff -Nur avahi-0.1/man/avahi-daemon.conf.5.xml.in avahi-0.1.new/man/avahi-daemon.conf.5.xml.in
79 --- avahi-0.1/man/avahi-daemon.conf.5.xml.in    2005-08-22 05:27:10.000000000 +0800
80 +++ avahi-0.1.new/man/avahi-daemon.conf.5.xml.in        2005-08-23 04:45:45.000000000 +0800
81 @@ -83,11 +83,13 @@
82        </option>
83  
84        <option>
85 -        <p><opt>enable-dbus=</opt> Takes a boolean value ("yes" or
86 -        "no"). If set to "yes" avahi-daemon connects to DBUS, to offer
87 -        an object oriented client API. Only available if avahi has
88 -        been compiled with <opt>--enable-dbus</opt> in which case it
89 -        defaults to "yes".</p>
90 +        <p><opt>enable-dbus=</opt> Takes either "yes", "no" or
91 +        "warn". If set to "yes" avahi-daemon connects to D-BUS,
92 +        offering an object oriented client API. It is only available
93 +        if avahi has been compiled with <opt>--enable-dbus</opt> in
94 +        which case it defaults to "yes". "warn" behaves like "yes",
95 +        but the daemon starts up even when it fails to connect to a
96 +        D-BUS daemon.</p>
97        </option>
98  
99         </section>