diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-02-20 21:17:43 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-02-20 21:17:43 +0000 |
commit | 29a14da1887360fedb12be48d4eca3aa265742f8 (patch) | |
tree | 42225066d54879665a1a5926efb2182cd253be49 | |
parent | b3e893b1d1ef52de4ace0d460066adbd1dee55fb (diff) |
Jose Pedro Oliveira: get_os_version_info() is more apropriate for shb_os
svn path=/trunk/; revision=41086
-rw-r--r-- | dumpcap.c | 10 | ||||
-rw-r--r-- | version_info.c | 28 | ||||
-rw-r--r-- | version_info.h | 5 |
3 files changed, 29 insertions, 14 deletions
@@ -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); diff --git a/version_info.c b/version_info.c index 887b9836dc..51ae5dd95a 100644 --- a/version_info.c +++ b/version_info.c @@ -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 */ diff --git a/version_info.h b/version_info.h index 0d85d17a5b..31548ef647 100644 --- a/version_info.h +++ b/version_info.h @@ -52,6 +52,11 @@ void get_compiled_version_info(GString *str, 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. */ |