I think the logic there is: "if setrlimit() succeeds, check what limit has actually been set". That code doesn't expect getrlimit() call to fail (since the same call succeeded previously), but assumes the actually set limit may be different from what was requested. In which case it returns the actual limit instead.
I think the logic there is: "if setrlimit() succeeds, check what limit has actually been set". That code doesn't expect getrlimit() call to fail (since the same call succeeded previously), but assumes the actually set limit may be different from what was requested. In which case it returns the actual limit instead.