diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2014-12-23 12:56:52 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-01-06 12:07:44 +0100 |
commit | a5076ad9c92895c54eb384b224e7af1a914f1fd9 (patch) | |
tree | 1d2ca57903940de11e8387661881008393759ee8 /libfstools | |
parent | 9847f4e2769d0d808a846724f8dd74b83280fdd8 (diff) | |
download | fstools-a5076ad9c92895c54eb384b224e7af1a914f1fd9.tar.gz |
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 <zajec5@gmail.com>
Diffstat (limited to 'libfstools')
-rw-r--r-- | libfstools/find.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; } } |