Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:Update
gjiten
bugzilla-348100-empty-radicals-window.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bugzilla-348100-empty-radicals-window.patch of Package gjiten
Index: gjiten-2.6/src/kanjidic.c =================================================================== --- gjiten-2.6.orig/src/kanjidic.c +++ gjiten-2.6/src/kanjidic.c @@ -55,6 +55,7 @@ gchar *kdic_line = NULL; /*size = KCFGN gchar kanjiselected[2]; gchar *radkfile = NULL; guint32 radkfile_size; +int radkfile_fd = -1; extern guint32 srchpos; GList *klinklist = NULL, *tmpklinklist = NULL; @@ -729,7 +730,6 @@ void load_radkfile() { gchar *radkfile_name = RADKFILE_NAME; gchar *radkfile_ptr; gchar *radkfile_end; - int fd = 0; RadInfo *rad_info = NULL; KanjiInfo *kanji_info; gunichar kanji; @@ -743,13 +743,17 @@ void load_radkfile() { error = TRUE; } radkfile_size = radk_stat.st_size; - fd = open(radkfile_name, O_RDONLY); - if (fd == -1) { + radkfile_fd = open(radkfile_name, O_RDONLY); + if (radkfile_fd == -1) { g_error("**ERROR** radkfile: open()\n"); error = TRUE; } - radkfile = (gchar *) mmap(NULL, radkfile_size, PROT_READ, MAP_SHARED, fd, 0); + radkfile = (gchar *) mmap(NULL, radkfile_size, PROT_READ, MAP_SHARED, radkfile_fd, 0); if (radkfile == NULL) gjiten_abort_with_msg("mmap() failed for radkfile\n"); + if ( radkfile_fd != -1 ) { + close(radkfile_fd); + } + radkfile_fd = -1; if (error == TRUE) { gjiten_print_error(_("Error opening %s.\n "\ @@ -899,6 +903,13 @@ static void kanjidic_close() { if (kanjiDic != NULL) { KanjiDic *tmp; radical_window_close(); + if (radkfile != NULL) { + munmap(radkfile, radkfile_size); + radkfile = NULL; + if ( radkfile_fd != -1 ) { + close(radkfile_fd); + } + } /* Avoid recursion */ tmp = kanjiDic;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor