+static int owfs_read(const char *mount_point, const char *path, char **res)
+{
+ char result[64];
+ char file[2048];
+ int fd, ret;
+
+ snprintf(file, sizeof(file), "%s/%s", mount_point, path);
+
+ fd = open(file, O_RDONLY | O_CLOEXEC);
+ if (fd < 0) {
+ pr_err("Failed to open file %s: %m\n", file);
+ return -1;
+ }
+
+ ret = read(fd, result, sizeof(result));
+ if (ret < 0) {
+ pr_err("Failed to read from file %s: %m\n", file);
+ goto out_close;
+ }
+
+ *res = strndup(result, sizeof(result));
+
+out_close:
+ close(fd);
+
+ return ret;
+}
+
+static int is_mount_point(const char *str)
+{
+ /*
+ * Filesystem paths begin with a slash, everything else must
+ * be a network addresses
+ */
+ if (str[0] == '/')
+ return 1;
+
+ return 0;
+}
+