From: Rafał Miłecki Date: Tue, 23 Dec 2014 11:56:52 +0000 (+0100) Subject: libfstools: fix find_mount to return device path X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a5076ad9c92895c54eb384b224e7af1a914f1fd9;p=oweals%2Ffstools.git libfstools: fix find_mount to return device path So far we were returning mount point which doesn't make sense for a function that already takes mount point as an argument. Signed-off-by: Rafał Miłecki --- diff --git a/libfstools/find.c b/libfstools/find.c index b50b633..4c69d73 100644 --- a/libfstools/find.c +++ b/libfstools/find.c @@ -36,6 +36,9 @@ find_overlay_mount(char *overlay) return ret; } +/* + * Find path of a device mounted to the given point. + */ char* find_mount(char *mp) { @@ -53,6 +56,7 @@ find_mount(char *mp) fclose(fp); return NULL; } + *t = '\0'; t++; s = strstr(t, " "); if (!s) { @@ -63,7 +67,7 @@ find_mount(char *mp) if (!strcmp(t, mp)) { fclose(fp); - return t; + return line; } }