]> git.meshlink.io Git - catta/blobdiff - avahi-utils/avahi-publish.c
fix compilation when compiled with DBM instead of gdbm. Patch supplied from Padraig...
[catta] / avahi-utils / avahi-publish.c
index 9d3e53c5bf2d3f5c1e2005089febc025809a5708..4e751763196ccbb3e5b9ec092359e0c486287879 100644 (file)
@@ -189,7 +189,11 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN
 
             if (config->verbose)
                 fprintf(stderr, "Host name conflict\n");
+
+            /* Fall through */
             
+        case AVAHI_CLIENT_S_REGISTERING:
+
             if (entry_group) {
                 avahi_entry_group_free(entry_group);
                 entry_group = NULL;
@@ -200,9 +204,9 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN
             
             if (config->verbose)
                 fprintf(stderr, "Waiting for daemon ...\n");
+            
             break;
             
-        case AVAHI_CLIENT_S_REGISTERING:
             ;
     }
 }
@@ -252,7 +256,6 @@ static int parse_command_line(Config *c, const char *argv0, int argc, char *argv
     c->port = 0;
     c->txt = c->subtypes = NULL;
 
-    opterr = 0;
     while ((o = getopt_long(argc, argv, "hVsavd:H:f", long_options, NULL)) >= 0) {
 
         switch(o) {
@@ -286,7 +289,6 @@ static int parse_command_line(Config *c, const char *argv0, int argc, char *argv
                 c->subtypes = avahi_string_list_add(c->subtypes, optarg);
                 break;
             default:
-                fprintf(stderr, "Invalid command line argument: %c\n", o);
                 return -1;
         }
     }
@@ -322,6 +324,8 @@ static int parse_command_line(Config *c, const char *argv0, int argc, char *argv
             fprintf(stderr, "Failed to parse port number: %s\n", argv[optind+2]);
             return -1;
         }
+
+        c->port = p;
             
         for (i = optind+3; i < argc; i++)
             c->txt = avahi_string_list_add(c->txt, argv[i]);