Ok, Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me,

2000-03-22  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

	* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
	<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
	path length might not be enough for the HURD. So I changed the
	loop to at least avoid an integer overflow, which could happen at
	beyond 2GB size ;-)
This commit is contained in:
Sebastian Wilhelmi 2000-03-22 15:18:11 +00:00 committed by Sebastian Wilhelmi
parent 762a2befa4
commit 837cbbdf8d
10 changed files with 42 additions and 2 deletions

View File

@ -1,5 +1,10 @@
2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
path length might not be enough for the HURD. So I changed the
loop to at least avoid an integer overflow.
* configure.in: Test for sched_yield as the native yield function * configure.in: Test for sched_yield as the native yield function
first. Corrected typo g_thread_sleep -> g_usleep. Corrected first. Corrected typo g_thread_sleep -> g_usleep. Corrected
message for the pthread_create test. Negative Priorities are message for the pthread_create test. Negative Priorities are

View File

@ -1,5 +1,10 @@
2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
path length might not be enough for the HURD. So I changed the
loop to at least avoid an integer overflow.
* configure.in: Test for sched_yield as the native yield function * configure.in: Test for sched_yield as the native yield function
first. Corrected typo g_thread_sleep -> g_usleep. Corrected first. Corrected typo g_thread_sleep -> g_usleep. Corrected
message for the pthread_create test. Negative Priorities are message for the pthread_create test. Negative Priorities are

View File

@ -1,5 +1,10 @@
2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
path length might not be enough for the HURD. So I changed the
loop to at least avoid an integer overflow.
* configure.in: Test for sched_yield as the native yield function * configure.in: Test for sched_yield as the native yield function
first. Corrected typo g_thread_sleep -> g_usleep. Corrected first. Corrected typo g_thread_sleep -> g_usleep. Corrected
message for the pthread_create test. Negative Priorities are message for the pthread_create test. Negative Priorities are

View File

@ -1,5 +1,10 @@
2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
path length might not be enough for the HURD. So I changed the
loop to at least avoid an integer overflow.
* configure.in: Test for sched_yield as the native yield function * configure.in: Test for sched_yield as the native yield function
first. Corrected typo g_thread_sleep -> g_usleep. Corrected first. Corrected typo g_thread_sleep -> g_usleep. Corrected
message for the pthread_create test. Negative Priorities are message for the pthread_create test. Negative Priorities are

View File

@ -1,5 +1,10 @@
2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
path length might not be enough for the HURD. So I changed the
loop to at least avoid an integer overflow.
* configure.in: Test for sched_yield as the native yield function * configure.in: Test for sched_yield as the native yield function
first. Corrected typo g_thread_sleep -> g_usleep. Corrected first. Corrected typo g_thread_sleep -> g_usleep. Corrected
message for the pthread_create test. Negative Priorities are message for the pthread_create test. Negative Priorities are

View File

@ -1,5 +1,10 @@
2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
path length might not be enough for the HURD. So I changed the
loop to at least avoid an integer overflow.
* configure.in: Test for sched_yield as the native yield function * configure.in: Test for sched_yield as the native yield function
first. Corrected typo g_thread_sleep -> g_usleep. Corrected first. Corrected typo g_thread_sleep -> g_usleep. Corrected
message for the pthread_create test. Negative Priorities are message for the pthread_create test. Negative Priorities are

View File

@ -1,5 +1,10 @@
2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
path length might not be enough for the HURD. So I changed the
loop to at least avoid an integer overflow.
* configure.in: Test for sched_yield as the native yield function * configure.in: Test for sched_yield as the native yield function
first. Corrected typo g_thread_sleep -> g_usleep. Corrected first. Corrected typo g_thread_sleep -> g_usleep. Corrected
message for the pthread_create test. Negative Priorities are message for the pthread_create test. Negative Priorities are

View File

@ -1,5 +1,10 @@
2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de> 2000-03-22 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gutils.c (g_get_current_dir): Ok, Marcus Brinkmann
<Marcus.Brinkmann@ruhr-uni-bochum.de> convinced me, that 128 KB
path length might not be enough for the HURD. So I changed the
loop to at least avoid an integer overflow.
* configure.in: Test for sched_yield as the native yield function * configure.in: Test for sched_yield as the native yield function
first. Corrected typo g_thread_sleep -> g_usleep. Corrected first. Corrected typo g_thread_sleep -> g_usleep. Corrected
message for the pthread_create test. Negative Priorities are message for the pthread_create test. Negative Priorities are

View File

@ -344,7 +344,7 @@ g_get_current_dir (void)
*buffer = 0; *buffer = 0;
dir = getwd (buffer); dir = getwd (buffer);
#else /* !sun */ #else /* !sun */
while (max_len < 128 * 1024) while (max_len < G_MAXULONG / 2)
{ {
buffer = g_new (gchar, max_len + 1); buffer = g_new (gchar, max_len + 1);
*buffer = 0; *buffer = 0;

View File

@ -344,7 +344,7 @@ g_get_current_dir (void)
*buffer = 0; *buffer = 0;
dir = getwd (buffer); dir = getwd (buffer);
#else /* !sun */ #else /* !sun */
while (max_len < 128 * 1024) while (max_len < G_MAXULONG / 2)
{ {
buffer = g_new (gchar, max_len + 1); buffer = g_new (gchar, max_len + 1);
*buffer = 0; *buffer = 0;