From: Andre Noll Date: Tue, 26 Apr 2011 14:33:44 +0000 (+0200) Subject: fd: Allow passing NULL to para_munmap(). X-Git-Tag: v0.4.7~13 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=8acdfc3d6d124581d0b624e61e0047f576eb4748 fd: Allow passing NULL to para_munmap(). This patch makes para_munmap succeed with return value 0 if the passed "start" pointer is NULL. This allows to simplify the code in the callers a bit, similar to free(NULL). --- diff --git a/fd.c b/fd.c index 6f9266f4..ea16bdda 100644 --- a/fd.c +++ b/fd.c @@ -563,6 +563,9 @@ out: int para_munmap(void *start, size_t length) { int err; + + if (!start) + return 0; if (munmap(start, length) >= 0) return 1; err = errno;