diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-10-09 10:38:37 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-10-09 10:38:37 +0000 |
commit | 7a6766da53fa06a02d818208c51801dd79e88a54 (patch) | |
tree | 1378bbe390e9cd8077f75efdd6ac1ee79be0bf80 /src/libs6rc/s6rc_livedir_suffixsize.c | |
parent | f9940bb7d1a6ce7d7772e8cbdbbd55a321cc5c18 (diff) | |
download | s6-rc-7a6766da53fa06a02d818208c51801dd79e88a54.tar.xz |
Replace suffix with prefix
Diffstat (limited to 'src/libs6rc/s6rc_livedir_suffixsize.c')
-rw-r--r-- | src/libs6rc/s6rc_livedir_suffixsize.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/libs6rc/s6rc_livedir_suffixsize.c b/src/libs6rc/s6rc_livedir_suffixsize.c deleted file mode 100644 index b571dad..0000000 --- a/src/libs6rc/s6rc_livedir_suffixsize.c +++ /dev/null @@ -1,24 +0,0 @@ -/* ISC license. */ - -#include <string.h> -#include <sys/stat.h> -#include <errno.h> -#include <s6-rc/s6rc-utils.h> - -int s6rc_livedir_suffixsize (char const *live, size_t *n) -{ - struct stat st ; - size_t llen = strlen(live) ; - char sfn[llen + 8] ; - memcpy(sfn, live, llen) ; - memcpy(sfn + llen, "/suffix", 8) ; - if (stat(sfn, &st) < 0) - { - if (errno != ENOENT) return 0 ; - *n = 0 ; - return 1 ; - } - if (!S_ISREG(st.st_mode)) return (errno = EINVAL, 0) ; - *n = st.st_size ; - return 1 ; -} |