]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r278803, r278905:
authorpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 22 Feb 2015 01:32:37 +0000 (01:32 +0000)
committerpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 22 Feb 2015 01:32:37 +0000 (01:32 +0000)
commit75b0ade4cd2c03482b78cd6898fe87d2d8131b98
treef4f2f4799593cac10fbaaa8b1a71415bcea3ae6d
parente0009d41372f11aa5305da39483073846ac6989e
MFC r278803, r278905:
ulimit(3): Fix broken check.

The existing implementation had a broken comparison that could
overflow and return confusing values.  Replace this with a check
that avoids the overflow before it happens.

Consistently return a maximum value also on the case of negative
arguments since negative is considered an overflow and means
infinity for our current setrlimit().

New revamped version is credited to Bruce Evans.

CID: 1199295

git-svn-id: svn://svn.freebsd.org/base/stable/9@279130 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/gen/ulimit.c