Jose Pedro Oliveira: get_os_version_info() is more apropriate for shb_os
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 20 Feb 2012 21:17:43 +0000 (21:17 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 20 Feb 2012 21:17:43 +0000 (21:17 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@41086 f5534014-38df-0310-8fa8-9805f1628bb7

dumpcap.c
version_info.c
version_info.h

index 8e001a9..fbe3777 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -2559,22 +2559,22 @@ capture_loop_init_output(capture_options *capture_opts, loop_data *ld, char *err
     if (ld->pdh) {
         if (capture_opts->use_pcapng) {
             char appname[100];
-            GString             *runtime_info_str;
+            GString             *os_info_str;
 
-            runtime_info_str = g_string_new("");
-            get_runtime_version_info(runtime_info_str, NULL);
+            os_info_str = g_string_new("");
+            get_os_version_info(os_info_str);
 
             g_snprintf(appname, sizeof(appname), "Dumpcap " VERSION "%s", wireshark_svnversion);
             successful = libpcap_write_session_header_block(ld->pdh, 
                                 NULL,                        /* Comment*/
                                 NULL,                        /* HW*/
-                                runtime_info_str->str,       /* OS*/
+                                os_info_str->str,            /* OS*/
                                 appname,
                                                                -1,                          /* section_length */
                                 &ld->bytes_written, 
                                 &err);
 
-            g_string_free(runtime_info_str, TRUE);
+            g_string_free(os_info_str, TRUE);
 
             for (i = 0; successful && (i < capture_opts->ifaces->len); i++) {
                 interface_opts = g_array_index(capture_opts->ifaces, interface_options, i);
index 887b983..51ae5dd 100644 (file)
@@ -167,11 +167,9 @@ typedef void (WINAPI *nativesi_func_ptr)(LPSYSTEM_INFO);
 #endif
 
 /*
- * Get various library run-time versions, and the OS version, and append
- * them to the specified GString.
+ * Get the OS version, and append it to the GString
  */
-void
-get_runtime_version_info(GString *str, void (*additional_info)(GString *))
+void get_os_version_info(GString *str)
 {
 #if defined(_WIN32)
        OSVERSIONINFOEX info;
@@ -183,11 +181,6 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
 #if HAVE_OS_X_FRAMEWORKS
        SInt32 macosx_ver, macosx_major_ver, macosx_minor_ver, macosx_bugfix_ver;
 #endif
-#ifndef _WIN32
-       gchar *lang;
-#endif
-
-       g_string_append(str, "on ");
 
 #if defined(_WIN32)
        /*
@@ -469,6 +462,23 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
 #else
        g_string_append(str, "an unknown OS");
 #endif
+}
+
+
+/*
+ * Get various library run-time versions, and the OS version, and append
+ * them to the specified GString.
+ */
+void
+get_runtime_version_info(GString *str, void (*additional_info)(GString *))
+{
+#ifndef _WIN32
+       gchar *lang;
+#endif
+
+       g_string_append(str, "on ");
+
+       get_os_version_info(str);
 
 #ifndef _WIN32
        /* Locale */
index 0d85d17..31548ef 100644 (file)
@@ -51,6 +51,11 @@ void get_compiled_version_info(GString *str,
     void (*prepend_info)(GString *),
     void (*append_info)(GString *));
 
+/*
+ * Get the OS version, and append it to the GString
+ */
+void get_os_version_info(GString *str);
+
 /*
  * Get various library run-time versions, and the OS version, and append
  * them to the specified GString.