From: Theodore Ts'o Date: Mon, 3 Dec 2001 04:47:32 +0000 (+0100) Subject: unix_io.c (unix_open): Make sure the ulimit workaround works X-Git-Tag: E2FSPROGS-1_26-WIP-1224~20 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bd27880b4ba42544f30a08ac3b6ba86190da021b;p=tools%2Fe2fsprogs.git unix_io.c (unix_open): Make sure the ulimit workaround works regardless of the version of glibc which is used to compild e2fsprogs. --- diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 419feff..bd1bb09 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,9 @@ +2001-12-03 Theodore Tso + + * 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 * 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 1e01d28..7fa4b1a 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); }