]> git.tuebingen.mpg.de Git - osl.git/blobdiff - fd.c
Do not specify LDLAGS twice.
[osl.git] / fd.c
diff --git a/fd.c b/fd.c
index c7c4f0f203a3ea2b39657b2345fe2049d9bc414a..84877602f943ee5893caaaab9db93b1292ccbab8 100644 (file)
--- a/fd.c
+++ b/fd.c
@@ -13,6 +13,7 @@
 #include <sys/select.h>
 
 #include "log.h"
+#include "osl.h"
 #include "error.h"
 
 /**
@@ -54,7 +55,7 @@ int write_all(int fd, const char *buf, size_t *len)
  *
  * \sa open(2).
  */
-int para_open(const char *path, int flags, mode_t mode)
+int osl_open(const char *path, int flags, mode_t mode)
 {
        int ret = open(path, flags, mode);
 
@@ -108,7 +109,7 @@ int para_opendir(const char *dirname, DIR **dir, int *cwd)
        int ret;
 
        if (cwd) {
-               ret = para_open(".", O_RDONLY, 0);
+               ret = osl_open(".", O_RDONLY, 0);
                if (ret < 0)
                        return ret;
                *cwd = ret;
@@ -143,21 +144,6 @@ int para_fchdir(int fd)
        return 1;
 }
 
-/**
- * A wrapper for mkdir(2).
- *
- * \param path Name of the directory to create.
- * \param mode The permissions to use.
- *
- * \return Standard.
- */
-int para_mkdir(const char *path, mode_t mode)
-{
-       if (!mkdir(path, mode))
-               return 1;
-       return -ERRNO_TO_ERROR(errno);
-}
-
 /**
  * Open a file and map it into memory.
  *
@@ -173,7 +159,7 @@ int para_mkdir(const char *path, mode_t mode)
  *
  * \return Standard.
  *
- * \sa para_open(), mmap(2).
+ * \sa osl_open(), mmap(2).
  */
 int mmap_full_file(const char *path, int open_mode, void **map,
                size_t *size, int *fd_ptr)
@@ -188,7 +174,7 @@ int mmap_full_file(const char *path, int open_mode, void **map,
                mmap_prot = PROT_READ | PROT_WRITE;
                mmap_flags = MAP_SHARED;
        }
-       ret = para_open(path, open_mode, 0);
+       ret = osl_open(path, open_mode, 0);
        if (ret < 0)
                return ret;
        fd = ret;
@@ -197,14 +183,14 @@ int mmap_full_file(const char *path, int open_mode, void **map,
                goto out;
        }
        *size = file_status.st_size;
-       ret = -E_EMPTY;
+       ret = -E_OSL_EMPTY;
        DEBUG_LOG("%s: size %zu\n", path, *size);
        if (!*size)
                goto out;
        *map = mmap(NULL, *size, mmap_prot, mmap_flags, fd, 0);
        if (*map == MAP_FAILED) {
                *map = NULL;
-               ret = -E_MMAP;
+               ret = -E_OSL_MMAP;
                goto out;
        }
        ret = 1;
@@ -226,7 +212,7 @@ out:
  *
  * \sa munmap(2), mmap_full_file().
  */
-int para_munmap(void *start, size_t length)
+int osl_munmap(void *start, size_t length)
 {
        int err;
        if (munmap(start, length) >= 0)