From 3b5c88ea4b8a9b4b85396a34ee658f3cdd1be156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Thu, 22 Jun 2017 09:49:16 -0400 Subject: wsutil: Back out profile_write_info_file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I89a9aaeeba1689cce04f239dafdc9003492aba16 Reviewed-on: https://code.wireshark.org/review/22346 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke --- wireshark-qt.cpp | 5 ----- wsutil/filesystem.c | 50 -------------------------------------------------- wsutil/filesystem.h | 5 ----- 3 files changed, 60 deletions(-) diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index e10f2e3f7b..7e4d597c7a 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -915,11 +915,6 @@ int main(int argc, char *qt_argv[]) g_free(get_persconffile_path("io_graphs", TRUE)); profile_store_persconffiles(FALSE); - if (!profile_write_info_file(&rf_path)) { - simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, - "Could not create file\n\"%s\"", rf_path); - g_free (rf_path); - } ret_val = wsApp->exec(); diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index efdfa7f779..4d28db0dc7 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -1238,56 +1238,6 @@ profile_store_persconffiles(gboolean store) do_store_persconffiles = store; } -static gint -compare_filename(gconstpointer dissector_a, gconstpointer dissector_b) -{ - return strcmp((const char*)dissector_a, (const char*)dissector_b); -} - -gboolean -profile_write_info_file(gchar **pf_dir_path_return) -{ - gchar *profile_dir, *info_file, *filename; - GList *files, *file; - ssize_t filename_len; - int fd; - - profile_dir = get_profiles_dir(); - info_file = g_strdup_printf("%s%s%s", profile_dir, G_DIR_SEPARATOR_S, PROFILES_INFO_NAME); - fd = ws_open(info_file, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); - if (fd < 0) { - g_free (profile_dir); - *pf_dir_path_return = info_file; - return FALSE; - } - - files = g_hash_table_get_keys(profile_files); - files = g_list_sort(files, compare_filename); - file = g_list_first(files); - while (file) { - filename = (gchar *)file->data; - filename_len = strlen(filename); - if ((ws_write(fd, filename, filename_len) != filename_len) || - (ws_write(fd, "\n", 1) != 1)) - { - ws_close(fd); - g_list_free(files); - g_free (profile_dir); - - *pf_dir_path_return = info_file; - return FALSE; - } - file = g_list_next(file); - } - g_list_free(files); - - ws_close(fd); - g_free(info_file); - g_free(profile_dir); - - return TRUE; -} - /* * Get the directory in which personal configuration files reside. * diff --git a/wsutil/filesystem.h b/wsutil/filesystem.h index c28e0a48db..f09e5ccaea 100644 --- a/wsutil/filesystem.h +++ b/wsutil/filesystem.h @@ -142,11 +142,6 @@ WS_DLL_PUBLIC char *get_global_profiles_dir(void); */ WS_DLL_PUBLIC void profile_store_persconffiles(gboolean store); -/* - * Store a list of all personal config files which belongs in a profile. - */ -WS_DLL_PUBLIC gboolean profile_write_info_file(gchar **pf_dir_path_return); - /* * Check if given configuration profile exists. */ -- cgit v1.2.1