X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=fd.c;h=236494515697ba18d01ad3e5049839d7780be6ad;hb=9190cb37a393b6f245a2bc17f9aeb9eb02a8e629;hp=cc38f1afba150e0de41fff093c0c5b7ccb24e377;hpb=15f6e433432a6ba8e021c74b0f28ecd545721d42;p=paraslash.git diff --git a/fd.c b/fd.c index cc38f1af..23649451 100644 --- a/fd.c +++ b/fd.c @@ -530,22 +530,21 @@ out: * \param start The start address of the memory mapping. * \param length The size of the mapping. * - * \return Standard. + * If NULL is passed as the start address, the length value is ignored and the + * function does nothing. + * + * \return Zero if NULL was passed, one if the memory area was successfully + * unmapped, a negative error code otherwise. * * \sa munmap(2), \ref mmap_full_file(). */ int para_munmap(void *start, size_t length) { - int err; - if (!start) return 0; if (munmap(start, length) >= 0) return 1; - err = errno; - PARA_ERROR_LOG("munmap (%p/%zu) failed: %s\n", start, length, - strerror(err)); - return -ERRNO_TO_PARA_ERROR(err); + return -ERRNO_TO_PARA_ERROR(errno); } /**