Commit 12bc3d82 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Fix off-by-one error. (#100853)

2002-12-11  Tor Lillqvist  <tml@iki.fi>

	* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)

	* glib/gfileutils.c (g_file_test): Bypass extra test for root on
	Win32.

	* glib/glib.def: Add g_{get,set}_application_name.
parent d0579998
2002-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
* glib/gfileutils.c (g_file_test): Bypass extra test for root on
Win32.
* glib/glib.def: Add g_{get,set}_application_name.
Wed Dec 11 17:53:34 2002 Owen Taylor <otaylor@redhat.com>
* === Release 2.1.4 ===
......
2002-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
* glib/gfileutils.c (g_file_test): Bypass extra test for root on
Win32.
* glib/glib.def: Add g_{get,set}_application_name.
Wed Dec 11 17:53:34 2002 Owen Taylor <otaylor@redhat.com>
* === Release 2.1.4 ===
......
2002-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
* glib/gfileutils.c (g_file_test): Bypass extra test for root on
Win32.
* glib/glib.def: Add g_{get,set}_application_name.
Wed Dec 11 17:53:34 2002 Owen Taylor <otaylor@redhat.com>
* === Release 2.1.4 ===
......
2002-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
* glib/gfileutils.c (g_file_test): Bypass extra test for root on
Win32.
* glib/glib.def: Add g_{get,set}_application_name.
Wed Dec 11 17:53:34 2002 Owen Taylor <otaylor@redhat.com>
* === Release 2.1.4 ===
......
2002-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
* glib/gfileutils.c (g_file_test): Bypass extra test for root on
Win32.
* glib/glib.def: Add g_{get,set}_application_name.
Wed Dec 11 17:53:34 2002 Owen Taylor <otaylor@redhat.com>
* === Release 2.1.4 ===
......
2002-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
* glib/gfileutils.c (g_file_test): Bypass extra test for root on
Win32.
* glib/glib.def: Add g_{get,set}_application_name.
Wed Dec 11 17:53:34 2002 Owen Taylor <otaylor@redhat.com>
* === Release 2.1.4 ===
......
2002-12-11 Tor Lillqvist <tml@iki.fi>
* glib/gtimer.c (g_timer_elapsed): Fix off-by-one error. (#100853)
* glib/gfileutils.c (g_file_test): Bypass extra test for root on
Win32.
* glib/glib.def: Add g_{get,set}_application_name.
Wed Dec 11 17:53:34 2002 Owen Taylor <otaylor@redhat.com>
* === Release 2.1.4 ===
......
......@@ -156,14 +156,16 @@ g_file_test (const gchar *filename,
if ((test & G_FILE_TEST_IS_DIR) && S_ISDIR (s.st_mode))
return TRUE;
#ifndef G_OS_WIN32
/* The extra test for root when access (file, X_OK) succeeds.
* Probably only makes sense on Unix.
*/
if ((test & G_FILE_TEST_IS_EXECUTABLE) &&
((s.st_mode & S_IXOTH) ||
(s.st_mode & S_IXUSR) ||
(s.st_mode & S_IXGRP)))
return TRUE;
#endif
}
}
......
......@@ -165,6 +165,7 @@ EXPORTS
g_find_program_in_path
g_fprintf
g_free
g_get_application_name
g_get_charset
g_get_codeset
g_get_current_dir
......@@ -480,6 +481,7 @@ EXPORTS
g_scanner_sync_file_offset
g_scanner_unexp_token
g_scanner_warn
g_set_application_name
g_set_error
g_set_prgname
g_set_print_handler
......
......@@ -135,7 +135,7 @@ g_timer_elapsed (GTimer *timer,
/* Check for wraparound, which happens every 49.7 days. */
if (timer->end < timer->start)
total = (UINT_MAX - (timer->start - timer->end)) / 1000.0;
total = (UINT_MAX - (timer->start - timer->end - 1)) / 1000.0;
else
total = (timer->end - timer->start) / 1000.0;
......@@ -143,7 +143,7 @@ g_timer_elapsed (GTimer *timer,
{
if (timer->end < timer->start)
*microseconds =
((UINT_MAX - (timer->start - timer->end)) % 1000) * 1000;
((UINT_MAX - (timer->start - timer->end - 1)) % 1000) * 1000;
else
*microseconds =
((timer->end - timer->start) % 1000) * 1000;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment