aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
diff options
context:
space:
mode:
authorUli Heilmeier <uh@heilmeier.eu>2019-05-27 11:48:47 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2019-05-27 10:43:14 +0000
commitc5fdbc564446f4ba06016231651d102c1c463402 (patch)
treee5caf249a80af1c0f46e472b0fa0b12ac32b9187 /epan/addr_resolv.c
parent26a4fb332b0febd39cf6f227ab54df36ee31ac7e (diff)
VLAN resolving: use existing file_exists() function
Use existsing file_exists() function to check if the profile contains a vlans file. Change-Id: Ibc3d32b27059edd80b7c4e88ceb48fded2334909 Reviewed-on: https://code.wireshark.org/review/33384 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r--epan/addr_resolv.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index 7068db574d..1584f75961 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -246,17 +246,6 @@ static GPtrArray* extra_hosts_files = NULL;
static hashether_t *add_eth_name(const guint8 *addr, const gchar *name);
static void add_serv_port_cb(const guint32 port, gpointer ptr);
-
-static gboolean check_file_exists(const char * filename){
- /* try to open file to read */
- FILE *file;
- if ((file = ws_fopen(filename, "r"))){
- fclose(file);
- return TRUE;
- }
- return FALSE;
-}
-
/* http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx#existing
* One-at-a-Time hash
*/
@@ -2122,7 +2111,7 @@ initialize_vlans(void)
if (g_pvlan_path == NULL) {
/* Check profile directory before personal configuration */
g_pvlan_path = get_persconffile_path(ENAME_VLANS, TRUE);
- if (!check_file_exists(g_pvlan_path)) {
+ if (!file_exists(g_pvlan_path)) {
g_free(g_pvlan_path);
g_pvlan_path = get_persconffile_path(ENAME_VLANS, FALSE);
}