unix_io.c (unix_open): Make sure the ulimit workaround works

regardless of the version of glibc which is used to
	compild e2fsprogs.
bitmap-optimize
Theodore Ts'o 2001-12-03 05:47:32 +01:00
parent a5f0bb9d1b
commit bd27880b4b
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2001-12-03 Theodore Tso <tytso@valinux.com>
* unix_io.c (unix_open): Make sure the ulimit workaround works
regardless of the version of glibc which is used to
compild e2fsprogs.
2001-11-26 Theodore Tso <tytso@valinux.com>
* unix_io.c (unix_open): Work around a bug in 2.4.10+ kernels by

View File

@ -346,11 +346,11 @@ static errcode_t unix_open(const char *name, int flags, io_channel *channel)
(S_ISBLK(st.st_mode))) {
struct rlimit rlim;
rlim.rlim_cur = RLIM_INFINITY;
rlim.rlim_max = RLIM_INFINITY;
rlim.rlim_cur = rlim.rlim_max = ((unsigned long)(~0UL));
setrlimit(RLIMIT_FSIZE, &rlim);
getrlimit(RLIMIT_FSIZE, &rlim);
if (rlim.rlim_cur != rlim.rlim_max) {
if (((unsigned long) rlim.rlim_cur) <
((unsigned long) rlim.rlim_max)) {
rlim.rlim_cur = rlim.rlim_max;
setrlimit(RLIMIT_FSIZE, &rlim);
}