From 02ccb50c6b8d55e9cf798503a11a7f11aeea6bca Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 26 May 2008 23:13:13 +0200 Subject: [PATCH] Make some functions static. And remove the "para" prefix while we're at it. --- fd.h | 1 - osl.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/fd.h b/fd.h index 80f484a..c3fec80 100644 --- a/fd.h +++ b/fd.h @@ -6,7 +6,6 @@ /** \file fd.h exported symbols from fd.c */ -int write_all(int fd, const char *buf, size_t *len); int para_open(const char *path, int flags, mode_t mode); int para_opendir(const char *dirname, DIR **dir, int *cwd); int para_mkdir(const char *path, mode_t mode); diff --git a/osl.c b/osl.c index 5786939..ded1e53 100644 --- a/osl.c +++ b/osl.c @@ -104,7 +104,7 @@ __printf_2_3 void __log(int ll, const char* fmt,...) * * \sa lseek(2). */ -int para_lseek(int fd, off_t *offset, int whence) +static int __lseek(int fd, off_t *offset, int whence) { *offset = lseek(fd, *offset, whence); int ret = -E_LSEEK; @@ -128,7 +128,7 @@ int para_lseek(int fd, off_t *offset, int whence) * * \sa write(2). */ -ssize_t para_write(int fd, const void *buf, size_t size) +static ssize_t __write(int fd, const void *buf, size_t size) { ssize_t ret; @@ -155,12 +155,12 @@ ssize_t para_write(int fd, const void *buf, size_t size) * * \sa para_write(). */ -ssize_t para_write_all(int fd, const void *buf, size_t size) +static ssize_t write_all(int fd, const void *buf, size_t size) { // DEBUG_LOG("writing %zu bytes\n", size); const char *b = buf; while (size) { - ssize_t ret = para_write(fd, b, size); + ssize_t ret = __write(fd, b, size); // DEBUG_LOG("ret: %zd\n", ret); if (ret < 0) return ret; @@ -189,7 +189,7 @@ int para_write_file(const char *filename, const void *buf, size_t size) if (ret < 0) return ret; fd = ret; - ret = para_write_all(fd, buf, size); + ret = write_all(fd, buf, size); if (ret < 0) goto out; ret = 1; @@ -209,16 +209,16 @@ static int append_file(const char *filename, char *header, size_t header_size, return ret; fd = ret; if (header && header_size) { - ret = para_write_all(fd, header, header_size); + ret = write_all(fd, header, header_size); if (ret < 0) goto out; } - ret = para_write_all(fd, data, data_size); + ret = write_all(fd, data, data_size); if (ret < 0) goto out; if (new_pos) { off_t offset = 0; - ret = para_lseek(fd, &offset, SEEK_END); + ret = __lseek(fd, &offset, SEEK_END); if (ret < 0) goto out; // DEBUG_LOG("new file size: " FMT_OFF_T "\n", offset); -- 2.39.2