diff options
author | Theodore Ts'o <tytso@mit.edu> | 2001-12-03 05:47:32 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2001-12-03 05:47:32 +0100 |
commit | bd27880b4ba42544f30a08ac3b6ba86190da021b (patch) | |
tree | 573f82d072182fc931f8bf4194b68494da562207 /lib | |
parent | a5f0bb9d1b295ad907b2d8a58ce9121f4105e1a8 (diff) | |
download | e2fsprogs-bd27880b4ba42544f30a08ac3b6ba86190da021b.tar.gz |
unix_io.c (unix_open): Make sure the ulimit workaround works
regardless of the version of glibc which is used to
compild e2fsprogs.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ext2fs/ChangeLog | 6 | ||||
-rw-r--r-- | lib/ext2fs/unix_io.c | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 419feffa..bd1bb098 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -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 diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index 1e01d285..7fa4b1a2 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -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); } |