diff options
Diffstat (limited to 'libmount/src')
-rw-r--r-- | libmount/src/context_mount.c | 1 | ||||
-rw-r--r-- | libmount/src/mountP.h | 5 | ||||
-rw-r--r-- | libmount/src/optmap.c | 1 | ||||
-rw-r--r-- | libmount/src/utils.c | 31 |
4 files changed, 2 insertions, 36 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index 94db1acd..4f376e4d 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -21,6 +21,7 @@ #include "linux_version.h" #include "mountP.h" +#include "strutils.h" /* * Kernel supports only one MS_PROPAGATION flag change by one mount(2) syscall, diff --git a/libmount/src/mountP.h b/libmount/src/mountP.h index 9e6f4bd2..9362c004 100644 --- a/libmount/src/mountP.h +++ b/libmount/src/mountP.h @@ -137,11 +137,6 @@ extern int mnt_run_test(struct libmnt_test *tests, int argc, char *argv[]); #endif /* utils.c */ -extern int endswith(const char *s, const char *sx) - __attribute__((nonnull)); -extern int startswith(const char *s, const char *sx) - __attribute__((nonnull)); - extern char *stripoff_last_component(char *path); extern int mnt_valid_tagname(const char *tagname); diff --git a/libmount/src/optmap.c b/libmount/src/optmap.c index 504a5cf8..5b25b8f2 100644 --- a/libmount/src/optmap.c +++ b/libmount/src/optmap.c @@ -58,6 +58,7 @@ * mount/mount.h. */ #include "mountP.h" +#include "strutils.h" /* * fs-independent mount flags (built-in MNT_LINUX_MAP) diff --git a/libmount/src/utils.c b/libmount/src/utils.c index 4e6a1314..9f992412 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -23,37 +23,6 @@ #include "env.h" #include "match.h" -int endswith(const char *s, const char *sx) -{ - ssize_t off; - - assert(s); - assert(sx); - - off = strlen(s); - if (!off) - return 0; - off -= strlen(sx); - if (off < 0) - return 0; - - return !strcmp(s + off, sx); -} - -int startswith(const char *s, const char *sx) -{ - size_t off; - - assert(s); - assert(sx); - - off = strlen(sx); - if (!off) - return 0; - - return !strncmp(s, sx, off); -} - int append_string(char **a, const char *b) { size_t al, bl; |