]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r298304:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 4 May 2016 07:37:02 +0000 (07:37 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 4 May 2016 07:37:02 +0000 (07:37 +0000)
commit879cab4d7e7ece02b3fa561cc8b6b4eb173bb7c9
treef47b46c1917492eb18bc5bed00622d4cb4ebf695
parent3e7f583abbfddb5f11055d2bf0a72a9cc630c817
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: 13313511331382-133138613315131331514133156513315831331694

git-svn-id: svn://svn.freebsd.org/base/stable/10@299058 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
tests/sys/posixshm/posixshm_test.c