]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - fd.c
fd: Remove log message from para_munmap().
[paraslash.git] / fd.c
diff --git a/fd.c b/fd.c
index 112f1835d3e228b9ce9ef9b1c515a067752017ae..236494515697ba18d01ad3e5049839d7780be6ad 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -392,22 +392,6 @@ int para_open(const char *path, int flags, mode_t mode)
        return -ERRNO_TO_PARA_ERROR(errno);
 }
 
-/**
- * Wrapper for chdir(2).
- *
- * \param path The specified directory.
- *
- * \return Standard.
- */
-int para_chdir(const char *path)
-{
-       int ret = chdir(path);
-
-       if (ret >= 0)
-               return 1;
-       return -ERRNO_TO_PARA_ERROR(errno);
-}
-
 /**
  * Save the cwd and open a given directory.
  *
@@ -443,9 +427,10 @@ static int para_opendir(const char *dirname, DIR **dir, int *cwd)
                        return ret;
                *cwd = ret;
        }
-       ret = para_chdir(dirname);
-       if (ret < 0)
+       if (chdir(dirname) != 0) {
+               ret = -ERRNO_TO_PARA_ERROR(errno);
                goto close_cwd;
+       }
        *dir = opendir(".");
        if (*dir)
                return 1;
@@ -545,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);
 }
 
 /**