mc/lib
Andrew Borodin 4a83daacc4 Ticket #4147: VFS timestamps: use g_get_real_time().
In the function vfs_expire(), curr_time and exp_time are declared
guint64. curr_time is initialised with a timestamp and exp_time
with this timestamp minus vfs_timeout seconds. Later there is if
(stamping->time <= exp_time). Prior to commit
a94dd7d2de curr_time was initialised with
a value larger than vfs_timeout seconds, so everything was fine. This
commit changed the initialisation to a timer starting when mc is
started. So for the first vfs_timeout seconds, the result of the
subtraction is negative, but it is a guint64, so we just get a VERY
large unsigned value and the if (stamping->time <= exp_time) is always
true. So mc thinks the vfs hasn't been used recently and goes into an
infinite loop.

If one opens a .rpm file with mc and goes into the CONTENTS.cpio and
then tries to go into the .tar.gz there (this is the usual structure of
a .rpm) after waiting vfs_timeout seconds, everything is fine. However,
before vfs_timeout seconds, mc hangs.

Solution: use g_get_real_time() instead of mc_timer_elapsed().

Thanks nvwarr at hotmail.com for finding out the reason for this bug.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2020-12-12 20:39:01 +03:00
..
event Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
filehighlight Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
mcconfig Rename macro MC_SKINS_SUBDIR to MC_SKINS_DIR. 2020-05-17 18:48:19 +03:00
search Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
skin Ticket #4120: draw shadows for dialog boxes and menus. 2020-08-02 16:13:26 +03:00
strutil Ticket #4131: use G_UNICODE_SPACING_MARK instead of G_UNICODE_COMBINING_MARK. 2020-10-15 15:16:24 +03:00
tty lib/tty/tty-ncurses.c: indentation. 2020-08-05 10:49:50 +03:00
vfs Ticket #4147: VFS timestamps: use g_get_real_time(). 2020-12-12 20:39:01 +03:00
widget Ticket #4145: file names longer than 255 bytes are not supported. 2020-12-12 20:23:05 +03:00
Makefile.am Ticket #3629: configure.ac: drop bundled gettext 2019-09-22 13:10:46 +03:00
charsets.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
charsets.h lib/charsets.[ch]: clarify usage of const qualifier. 2016-04-16 10:23:44 +03:00
event-types.h Reimplement handling of ev_vfs_print_message_t message. 2015-11-05 14:33:21 +03:00
event.h (mc_event_mass_add): make events const. 2018-02-04 11:30:23 +03:00
filehighlight.h filehighlight: clarify includes. 2016-03-04 09:23:36 +03:00
fileloc.h Rename macro MC_SKINS_SUBDIR to MC_SKINS_DIR. 2020-05-17 18:48:19 +03:00
fs.h Ticket #3464: (compute_namelen): remove... 2015-05-24 17:59:18 +03:00
glibcompat.c (mc_g_string_copy): new API that extends GString one. 2020-12-12 20:23:05 +03:00
glibcompat.h (mc_g_string_copy): new API that extends GString one. 2020-12-12 20:23:05 +03:00
global.c Ticket #4120: draw shadows for dialog boxes and menus. 2020-08-02 16:13:26 +03:00
global.h Ticket #4120: draw shadows for dialog boxes and menus. 2020-08-02 16:13:26 +03:00
hook.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
hook.h fixed doxygen documentation 2012-09-10 14:29:53 +03:00
keybind.c Create command_names using macro. 2020-10-13 16:34:47 +03:00
keybind.h Create command_names using macro. 2020-10-13 16:34:47 +03:00
lock.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
lock.h Changed lock_file() and unlock_file() functions 2012-03-06 11:52:30 +03:00
logging.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
logging.h Clarify __attribute ((format (printf))) usage. 2015-11-05 14:33:20 +03:00
mcconfig.h Move history operation routines from lib/widget/history.c to lib/mcconfig/history.c. 2019-09-01 19:41:12 +03:00
search.h (mc_search_set_error): cleanup compile warning on older gcc compilers: 2016-07-29 09:29:36 +03:00
serialize.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
serialize.h lib/mcconfig: fix coding style; apply source file template. 2019-09-01 19:41:12 +03:00
shell.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
shell.h Add mc_shell_init() and mc_shell_deinit() functions. 2016-01-01 11:48:06 +03:00
skin.h Ticket #4120: draw shadows for dialog boxes and menus. 2020-08-02 16:13:26 +03:00
stat-size.h Remove Cray support. 2020-10-13 16:34:55 +03:00
strescape.h Code indentation in lib directory 2010-11-24 10:27:20 +03:00
strutil.h Fix file version sort. 2019-03-02 11:24:07 +03:00
timefmt.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
timefmt.h Moved time related stuff from lib/util.[ch] into lib/timefmt.[ch]. 2010-11-24 10:27:47 +03:00
timer.c mc_timer: use g_get_real_time() instead of gettimeofday(). 2020-10-13 16:34:55 +03:00
timer.h Ticket #2136: implement user-friendly interruption of long-time operations. 2014-07-22 13:40:30 +04:00
unixcompat.h Sync with gnulib 4d4877e6c2123c4862c321f3eab28a55bf886216. 2018-11-24 14:40:42 +03:00
util.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
util.h Optimize comparisions in file sort functions. 2020-10-13 16:34:55 +03:00
utilunix.c Ticket #4050: code cleanup before 4.8.25 release. 2020-02-29 19:10:17 +03:00
utilunix.h Lib: removed includes to "src" directory 2011-03-21 23:55:52 +02:00
widget.h Create WBackground widget. 2020-03-08 20:17:29 +03:00