summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/mount-util.c23
-rw-r--r--src/basic/mount-util.h16
-rw-r--r--src/basic/stat-util.h1
-rw-r--r--src/basic/util.c23
-rw-r--r--src/basic/util.h8
5 files changed, 39 insertions, 32 deletions
diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c
index fefa50709c..d04e7492e5 100644
--- a/src/basic/mount-util.c
+++ b/src/basic/mount-util.c
@@ -483,3 +483,26 @@ int mount_move_root(const char *path) {
return 0;
}
+
+bool fstype_is_network(const char *fstype) {
+ static const char table[] =
+ "afs\0"
+ "cifs\0"
+ "smbfs\0"
+ "sshfs\0"
+ "ncpfs\0"
+ "ncp\0"
+ "nfs\0"
+ "nfs4\0"
+ "gfs\0"
+ "gfs2\0"
+ "glusterfs\0";
+
+ const char *x;
+
+ x = startswith(fstype, "fuse.");
+ if (x)
+ fstype = x;
+
+ return nulstr_contains(table, fstype);
+}
diff --git a/src/basic/mount-util.h b/src/basic/mount-util.h
index b415d00e2f..c87ae93e55 100644
--- a/src/basic/mount-util.h
+++ b/src/basic/mount-util.h
@@ -21,8 +21,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdbool.h>
+#include <fcntl.h>
#include <mntent.h>
+#include <stdbool.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "missing.h"
int fd_is_mount_point(int fd, const char *filename, int flags);
int path_is_mount_point(const char *path, int flags);
@@ -34,3 +39,12 @@ int mount_move_root(const char *path);
DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent);
#define _cleanup_endmntent_ _cleanup_(endmntentp)
+
+bool fstype_is_network(const char *fstype);
+
+union file_handle_union {
+ struct file_handle handle;
+ char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
+};
+
+#define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ }
diff --git a/src/basic/stat-util.h b/src/basic/stat-util.h
index 82edea06a8..909b220a24 100644
--- a/src/basic/stat-util.h
+++ b/src/basic/stat-util.h
@@ -23,6 +23,7 @@
#include <stdbool.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/vfs.h>
#include "macro.h"
diff --git a/src/basic/util.c b/src/basic/util.c
index 62d58c13fd..da7de27a04 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -125,29 +125,6 @@ size_t page_size(void) {
return pgsz;
}
-bool fstype_is_network(const char *fstype) {
- static const char table[] =
- "afs\0"
- "cifs\0"
- "smbfs\0"
- "sshfs\0"
- "ncpfs\0"
- "ncp\0"
- "nfs\0"
- "nfs4\0"
- "gfs\0"
- "gfs2\0"
- "glusterfs\0";
-
- const char *x;
-
- x = startswith(fstype, "fuse.");
- if (x)
- fstype = x;
-
- return nulstr_contains(table, fstype);
-}
-
void rename_process(const char name[8]) {
assert(name);
diff --git a/src/basic/util.h b/src/basic/util.h
index e2fceafd9a..fc329a869b 100644
--- a/src/basic/util.h
+++ b/src/basic/util.h
@@ -66,8 +66,6 @@ static inline const char* one_zero(bool b) {
return b ? "1" : "0";
}
-bool fstype_is_network(const char *fstype);
-
noreturn void freeze(void);
void execute_directories(const char* const* directories, usec_t timeout, char *argv[]);
@@ -202,12 +200,6 @@ const char *personality_to_string(unsigned long);
uint64_t physical_memory(void);
-union file_handle_union {
- struct file_handle handle;
- char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ];
-};
-#define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ }
-
int update_reboot_param_file(const char *param);
#define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)