ngie c952e2bbbe MFC r298304:
Fix issues identified by Coverity

- Always munmap memory regions after mmap'ing them.
- Make sure getpagesize() returns a value greater than 0 and use a
  cached value instead of always calling getpagesize(3).
- Remove intermediate variable for assigning from $TMPDIR if set in the
  environment to eliminate warnings about pointer conversions with "/tmp",
  and to mute an invalid buffer overflow concern from Coverity
  (snprintf and tacking on a NUL terminator was alleviating that concern
  before).
- Remove useless self-test of psize before it's initialized.
- Check the return values of getrlimit/setrlimit.

Cosmetic changes:
- Replace a `(void*)0` with NULL.
- Do some minor whitespace clean up.
- Remove an unnecessary cast to mmap.
- Make all munmap calls use ATF_REQUIRE_MSG instead of using the:

  > if (munmap(..) == -1)
  >    atf_tc_fail(..)

  idiom. Employ the new idiom consistently when calling munmap.

CID: 1331351, 1331382-1331386, 1331513, 1331514, 1331565, 1331583, 1331694
2016-05-04 07:37:02 +00:00
..
2016-03-12 19:00:42 +00:00
2016-01-04 07:02:48 +00:00
2015-08-11 01:51:38 +00:00
2016-04-22 21:30:42 +00:00
2016-04-06 06:37:36 +00:00
2016-01-06 20:50:23 +00:00
2016-04-14 17:14:11 +00:00
2016-01-06 20:06:15 +00:00
2014-12-31 23:25:37 +00:00
2015-12-04 18:59:20 +00:00
2016-05-04 07:37:02 +00:00
2015-10-26 03:37:01 +00:00
2016-05-04 07:35:43 +00:00
2016-03-14 01:31:40 +00:00