From ad90bc1107ef9a76f4ca530cc41e86d4f352e3d9 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 26 Oct 2020 12:52:31 +0000 Subject: Change new function names to openc_*; update deps.mak --- src/libstddjb/open_appendcoe.c | 10 ---------- src/libstddjb/open_createcoe.c | 10 ---------- src/libstddjb/open_exclcoe.c | 10 ---------- src/libstddjb/open_readbcoe.c | 15 --------------- src/libstddjb/open_readcoe.c | 10 ---------- src/libstddjb/open_trunccoe.c | 10 ---------- src/libstddjb/open_writecoe.c | 10 ---------- src/libstddjb/openb_readcoe.c | 10 ---------- src/libstddjb/openbc_read.c | 10 ++++++++++ src/libstddjb/openc_append.c | 10 ++++++++++ src/libstddjb/openc_create.c | 10 ++++++++++ src/libstddjb/openc_excl.c | 10 ++++++++++ src/libstddjb/openc_read.c | 10 ++++++++++ src/libstddjb/openc_readb.c | 15 +++++++++++++++ src/libstddjb/openc_trunc.c | 10 ++++++++++ src/libstddjb/openc_write.c | 10 ++++++++++ src/libstddjb/openreadfileclose.c | 2 +- src/libstddjb/openreadnclose.c | 4 ++-- src/libstddjb/openslurpclose.c | 2 +- src/libstddjb/openwritenclose_unsafe.c | 2 +- src/libstddjb/openwritevnclose_unsafe.c | 2 +- 21 files changed, 91 insertions(+), 91 deletions(-) delete mode 100644 src/libstddjb/open_appendcoe.c delete mode 100644 src/libstddjb/open_createcoe.c delete mode 100644 src/libstddjb/open_exclcoe.c delete mode 100644 src/libstddjb/open_readbcoe.c delete mode 100644 src/libstddjb/open_readcoe.c delete mode 100644 src/libstddjb/open_trunccoe.c delete mode 100644 src/libstddjb/open_writecoe.c delete mode 100644 src/libstddjb/openb_readcoe.c create mode 100644 src/libstddjb/openbc_read.c create mode 100644 src/libstddjb/openc_append.c create mode 100644 src/libstddjb/openc_create.c create mode 100644 src/libstddjb/openc_excl.c create mode 100644 src/libstddjb/openc_read.c create mode 100644 src/libstddjb/openc_readb.c create mode 100644 src/libstddjb/openc_trunc.c create mode 100644 src/libstddjb/openc_write.c (limited to 'src/libstddjb') diff --git a/src/libstddjb/open_appendcoe.c b/src/libstddjb/open_appendcoe.c deleted file mode 100644 index 3bda62e..0000000 --- a/src/libstddjb/open_appendcoe.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ISC license. */ - -#include -#include -#include - -int open_appendcoe (char const *fn) -{ - return open3(fn, O_WRONLY | O_NONBLOCK | O_APPEND | O_CREAT | O_CLOEXEC, 0666) ; -} diff --git a/src/libstddjb/open_createcoe.c b/src/libstddjb/open_createcoe.c deleted file mode 100644 index 4f42f78..0000000 --- a/src/libstddjb/open_createcoe.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ISC license. */ - -#include -#include -#include - -int open_createcoe (char const *fn) -{ - return open3(fn, O_WRONLY | O_NONBLOCK | O_CREAT | O_CLOEXEC, 0666) ; -} diff --git a/src/libstddjb/open_exclcoe.c b/src/libstddjb/open_exclcoe.c deleted file mode 100644 index b24786c..0000000 --- a/src/libstddjb/open_exclcoe.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ISC license. */ - -#include -#include -#include - -int open_exclcoe (char const *fn) -{ - return open3(fn, O_WRONLY | O_CREAT | O_EXCL | O_NONBLOCK | O_CLOEXEC, 0666) ; -} diff --git a/src/libstddjb/open_readbcoe.c b/src/libstddjb/open_readbcoe.c deleted file mode 100644 index d461854..0000000 --- a/src/libstddjb/open_readbcoe.c +++ /dev/null @@ -1,15 +0,0 @@ -/* ISC license. */ - -#include - -int open_readbcoe (char const *fn) -{ - int fd = open_readbcoe(fn) ; - if (fd < 0) return -1 ; - if (ndelay_off(fd) < 0) - { - fd_close(fd) ; - return -1 ; - } - return fd ; -} diff --git a/src/libstddjb/open_readcoe.c b/src/libstddjb/open_readcoe.c deleted file mode 100644 index cd6a69d..0000000 --- a/src/libstddjb/open_readcoe.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ISC license. */ - -#include -#include -#include - -int open_readcoe (char const *fn) -{ - return open2(fn, O_RDONLY | O_NONBLOCK | O_CLOEXEC) ; -} diff --git a/src/libstddjb/open_trunccoe.c b/src/libstddjb/open_trunccoe.c deleted file mode 100644 index 3be3df6..0000000 --- a/src/libstddjb/open_trunccoe.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ISC license. */ - -#include -#include -#include - -int open_trunccoe (char const *fn) -{ - return open3(fn, O_WRONLY | O_NONBLOCK | O_TRUNC | O_CREAT | O_CLOEXEC, 0666) ; -} diff --git a/src/libstddjb/open_writecoe.c b/src/libstddjb/open_writecoe.c deleted file mode 100644 index d04c4c5..0000000 --- a/src/libstddjb/open_writecoe.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ISC license. */ - -#include -#include -#include - -int open_writecoe (char const *fn) -{ - return open2(fn, O_WRONLY | O_NONBLOCK | O_CLOEXEC) ; -} diff --git a/src/libstddjb/openb_readcoe.c b/src/libstddjb/openb_readcoe.c deleted file mode 100644 index 933830e..0000000 --- a/src/libstddjb/openb_readcoe.c +++ /dev/null @@ -1,10 +0,0 @@ -/* ISC license. */ - -#include -#include -#include - -int openb_readcoe (char const *fn) -{ - return open2(fn, O_RDONLY | O_CLOEXEC) ; -} diff --git a/src/libstddjb/openbc_read.c b/src/libstddjb/openbc_read.c new file mode 100644 index 0000000..4783780 --- /dev/null +++ b/src/libstddjb/openbc_read.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include +#include +#include + +int openbc_read (char const *fn) +{ + return open2(fn, O_RDONLY | O_CLOEXEC) ; +} diff --git a/src/libstddjb/openc_append.c b/src/libstddjb/openc_append.c new file mode 100644 index 0000000..9765aa6 --- /dev/null +++ b/src/libstddjb/openc_append.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include +#include +#include + +int openc_append (char const *fn) +{ + return open3(fn, O_WRONLY | O_NONBLOCK | O_APPEND | O_CREAT | O_CLOEXEC, 0666) ; +} diff --git a/src/libstddjb/openc_create.c b/src/libstddjb/openc_create.c new file mode 100644 index 0000000..2c0dd86 --- /dev/null +++ b/src/libstddjb/openc_create.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include +#include +#include + +int openc_create (char const *fn) +{ + return open3(fn, O_WRONLY | O_NONBLOCK | O_CREAT | O_CLOEXEC, 0666) ; +} diff --git a/src/libstddjb/openc_excl.c b/src/libstddjb/openc_excl.c new file mode 100644 index 0000000..9a45913 --- /dev/null +++ b/src/libstddjb/openc_excl.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include +#include +#include + +int openc_excl (char const *fn) +{ + return open3(fn, O_WRONLY | O_CREAT | O_EXCL | O_NONBLOCK | O_CLOEXEC, 0666) ; +} diff --git a/src/libstddjb/openc_read.c b/src/libstddjb/openc_read.c new file mode 100644 index 0000000..57a23bc --- /dev/null +++ b/src/libstddjb/openc_read.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include +#include +#include + +int openc_read (char const *fn) +{ + return open2(fn, O_RDONLY | O_NONBLOCK | O_CLOEXEC) ; +} diff --git a/src/libstddjb/openc_readb.c b/src/libstddjb/openc_readb.c new file mode 100644 index 0000000..e0bfcc0 --- /dev/null +++ b/src/libstddjb/openc_readb.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include + +int openc_readb (char const *fn) +{ + int fd = openc_read(fn) ; + if (fd < 0) return -1 ; + if (ndelay_off(fd) < 0) + { + fd_close(fd) ; + return -1 ; + } + return fd ; +} diff --git a/src/libstddjb/openc_trunc.c b/src/libstddjb/openc_trunc.c new file mode 100644 index 0000000..ca39160 --- /dev/null +++ b/src/libstddjb/openc_trunc.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include +#include +#include + +int openc_trunc (char const *fn) +{ + return open3(fn, O_WRONLY | O_NONBLOCK | O_TRUNC | O_CREAT | O_CLOEXEC, 0666) ; +} diff --git a/src/libstddjb/openc_write.c b/src/libstddjb/openc_write.c new file mode 100644 index 0000000..518c460 --- /dev/null +++ b/src/libstddjb/openc_write.c @@ -0,0 +1,10 @@ +/* ISC license. */ + +#include +#include +#include + +int openc_write (char const *fn) +{ + return open2(fn, O_WRONLY | O_NONBLOCK | O_CLOEXEC) ; +} diff --git a/src/libstddjb/openreadfileclose.c b/src/libstddjb/openreadfileclose.c index 95895e8..afa895a 100644 --- a/src/libstddjb/openreadfileclose.c +++ b/src/libstddjb/openreadfileclose.c @@ -8,7 +8,7 @@ int openreadfileclose (char const *file, stralloc *sa, size_t limit) { size_t n ; - int fd = openb_readcoe(file) ; + int fd = openbc_read(file) ; if (fd < 0) return 0 ; { struct stat st ; diff --git a/src/libstddjb/openreadnclose.c b/src/libstddjb/openreadnclose.c index 0853c87..4466796 100644 --- a/src/libstddjb/openreadnclose.c +++ b/src/libstddjb/openreadnclose.c @@ -22,12 +22,12 @@ static ssize_t readnclose (int fd, char *s, size_t n) ssize_t openreadnclose (char const *file, char *s, size_t n) { - int fd = openb_readcoe(file) ; + int fd = openbc_read(file) ; return fd < 0 ? fd : readnclose(fd, s, n) ; } ssize_t openreadnclose_nb (char const *file, char *s, size_t n) { - int fd = open_readcoe(file) ; + int fd = openc_read(file) ; return fd < 0 ? fd : readnclose(fd, s, n) ; } diff --git a/src/libstddjb/openslurpclose.c b/src/libstddjb/openslurpclose.c index 6a431d0..8485413 100644 --- a/src/libstddjb/openslurpclose.c +++ b/src/libstddjb/openslurpclose.c @@ -6,7 +6,7 @@ int openslurpclose (stralloc *sa, char const *fn) { int r ; - int fd = openb_readcoe(fn) ; + int fd = openbc_read(fn) ; if (fd == -1) return 0 ; r = slurp(sa, fd) ; fd_close(fd) ; diff --git a/src/libstddjb/openwritenclose_unsafe.c b/src/libstddjb/openwritenclose_unsafe.c index 893fc3a..8022f74 100644 --- a/src/libstddjb/openwritenclose_unsafe.c +++ b/src/libstddjb/openwritenclose_unsafe.c @@ -6,7 +6,7 @@ int openwritenclose_unsafe_internal (char const *fn, char const *s, size_t len, dev_t *dev, ino_t *ino, int dosync) { - int fd = open_trunccoe(fn) ; + int fd = openc_trunc(fn) ; if (fd < 0) return 0 ; if (!writenclose_unsafe_internal(fd, s, len, dev, ino, dosync)) { diff --git a/src/libstddjb/openwritevnclose_unsafe.c b/src/libstddjb/openwritevnclose_unsafe.c index d707fb0..ca98f1c 100644 --- a/src/libstddjb/openwritevnclose_unsafe.c +++ b/src/libstddjb/openwritevnclose_unsafe.c @@ -8,7 +8,7 @@ int openwritevnclose_unsafe_internal (char const *fn, struct iovec const *v, unsigned int vlen, dev_t *dev, ino_t *ino, int dosync) { - int fd = open_trunccoe(fn) ; + int fd = openc_trunc(fn) ; if (fd < 0) return 0 ; if (!writevnclose_unsafe_internal(fd, v, vlen, dev, ino, dosync)) { -- cgit v1.2.3