return ret;
}
+/*
+ * Find path of a device mounted to the given point.
+ */
char*
find_mount(char *mp)
{
fclose(fp);
return NULL;
}
+ *t = '\0';
t++;
s = strstr(t, " ");
if (!s) {
if (!strcmp(t, mp)) {
fclose(fp);
- return t;
+ return line;
}
}
}
char*
-find_mount_point(char *block, char *fs)
+find_mount_point(char *block, int root_only)
{
FILE *fp = fopen("/proc/mounts", "r");
static char line[256];
*t = '\0';
t++;
- if (fs && strncmp(t, fs, strlen(fs))) {
+ if (root_only &&
+ strncmp(t, "f2fs", 4) &&
+ strncmp(t, "jffs2", 5) &&
+ strncmp(t, "ubifs", 5)) {
fclose(fp);
- fprintf(stderr, "block is mounted with wrong fs\n");
+ ULOG_ERR("block is mounted with wrong fs\n");
return NULL;
}
point = p;
int ret = -1;
if (!fp) {
- fprintf(stderr, "opening /proc/filesystems failed: %s\n", strerror(errno));
+ ULOG_ERR("opening /proc/filesystems failed: %s\n", strerror(errno));
goto out;
}