]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r278803, r278905:
authorpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 22 Feb 2015 01:31:28 +0000 (01:31 +0000)
committerpfg <pfg@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 22 Feb 2015 01:31:28 +0000 (01:31 +0000)
commitec2a0970d2bff830aea68f5fecdc599cd3ee4a70
tree5d4fd923f8d1543ebc5c268747c15e8582da2a72
parentde33d21a9dc115677e19e3fdf729b59b9d825696
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/10@279129 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/gen/ulimit.c