Try to improve the "Kerberos requested but not OpenSSL" message.
[jelmer/wireshark.git] / dumpcap.c
index d53013f22a6b3dc24879b2d00b30062088e985fb..56a28fea7b880d1990222b29d35043e6cf9e6c9e 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -1,6 +1,4 @@
 /* dumpcap.c
- *
- * $Id$
  *
  * Wireshark - Network traffic analyzer
  * By Gerald Combs <gerald@wireshark.org>
@@ -180,7 +178,7 @@ static void cap_pipe_close(int pipe_fd, gboolean from_socket _U_);
  * and not continue to capture, should we report it as a warning, or
  * what?
  */
-void
+static void
 enable_kernel_bpf_jit_compiler(void)
 {
     int fd;
@@ -480,7 +478,7 @@ print_usage(gboolean print_ver)
                 "Dumpcap " VERSION "%s\n"
                 "Capture network packets and dump them into a pcapng file.\n"
                 "See http://www.wireshark.org for more information.\n",
-                wireshark_svnversion);
+                wireshark_gitversion);
     } else {
         output = stderr;
     }
@@ -570,7 +568,7 @@ show_version(GString *comp_info_str, GString *runtime_info_str)
         "%s\n"
         "%s\n"
         "See http://www.wireshark.org for more information.\n",
-        wireshark_svnversion, get_copyright_info(), comp_info_str->str, runtime_info_str->str);
+        wireshark_gitversion, get_copyright_info(), comp_info_str->str, runtime_info_str->str);
 }
 
 /*
@@ -1353,7 +1351,7 @@ print_machine_readable_interfaces(GList *if_list)
         else
             printf("\t");
 
-        printf("%u\t", if_info->type);
+        printf("%i\t", if_info->type);
 
         for (addr = g_slist_nth(if_info->addrs, 0); addr != NULL;
                     addr = g_slist_next(addr)) {
@@ -1379,7 +1377,7 @@ print_machine_readable_interfaces(GList *if_list)
                 }
                 break;
             default:
-                printf("<type unknown %u>", if_addr->ifat_type);
+                printf("<type unknown %i>", if_addr->ifat_type);
             }
         }
 
@@ -1968,7 +1966,7 @@ cap_pipe_open_live(char *pipename,
     wchar_t *err_str;
 #endif
     ssize_t  b;
-    int      fd, sel_ret;
+    int      fd = -1, sel_ret;
     size_t   bytes_read;
     guint32  magic = 0;
 
@@ -2146,6 +2144,11 @@ cap_pipe_open_live(char *pipename,
         /* read the pcap header */
         bytes_read = 0;
         while (bytes_read < sizeof magic) {
+            if (fd == -1) {
+                g_snprintf(errmsg, errmsgl, "Invalid file descriptor");
+                goto error;
+            }
+
             sel_ret = cap_pipe_select(fd);
             if (sel_ret < 0) {
                 g_snprintf(errmsg, errmsgl,
@@ -2872,7 +2875,7 @@ capture_loop_init_output(capture_options *capture_opts, loop_data *ld, char *err
             os_info_str = g_string_new("");
             get_os_version_info(os_info_str);
 
-            g_snprintf(appname, sizeof(appname), "Dumpcap " VERSION "%s", wireshark_svnversion);
+            g_snprintf(appname, sizeof(appname), "Dumpcap " VERSION "%s", wireshark_gitversion);
             successful = pcapng_write_session_header_block(ld->pdh,
                                 (const char *)capture_opts->capture_comment,   /* Comment*/
                                 NULL,                        /* HW*/
@@ -3365,7 +3368,7 @@ do_file_switch_or_stop(capture_options *capture_opts,
                 os_info_str = g_string_new("");
                 get_os_version_info(os_info_str);
 
-                g_snprintf(appname, sizeof(appname), "Dumpcap " VERSION "%s", wireshark_svnversion);
+                g_snprintf(appname, sizeof(appname), "Dumpcap " VERSION "%s", wireshark_gitversion);
                 successful = pcapng_write_session_header_block(global_ld.pdh,
                                 NULL,                        /* Comment */
                                 NULL,                        /* HW */
@@ -4219,7 +4222,7 @@ main(int argc, char *argv[])
            "%s"
            "\n"
            "%s",
-        wireshark_svnversion, comp_info_str->str, runtime_info_str->str);
+        wireshark_gitversion, comp_info_str->str, runtime_info_str->str);
 
 #ifdef _WIN32
     arg_list_utf_16to8(argc, argv);