mountinfo: fix --netdev and --nonetdev on Linux
On Linux, the --netdev and --nonetdev switches were not working. They were both returning false. After this change, they operate based on the presence or abscence of the _netdev option in mount options.
This commit is contained in:
parent
b3f7ff901f
commit
5f4f242036
@ -305,7 +305,6 @@ find_mounts(struct args *args)
|
|||||||
|
|
||||||
buffer = xmalloc(sizeof(char) * PATH_MAX * 3);
|
buffer = xmalloc(sizeof(char) * PATH_MAX * 3);
|
||||||
while (fgets(buffer, PATH_MAX * 3, fp)) {
|
while (fgets(buffer, PATH_MAX * 3, fp)) {
|
||||||
netdev = -1;
|
|
||||||
p = buffer;
|
p = buffer;
|
||||||
from = strsep(&p, " ");
|
from = strsep(&p, " ");
|
||||||
to = strsep(&p, " ");
|
to = strsep(&p, " ");
|
||||||
@ -315,6 +314,8 @@ find_mounts(struct args *args)
|
|||||||
if ((ent = getmntfile(to))) {
|
if ((ent = getmntfile(to))) {
|
||||||
if (strstr(ent->mnt_opts, "_netdev"))
|
if (strstr(ent->mnt_opts, "_netdev"))
|
||||||
netdev = 0;
|
netdev = 0;
|
||||||
|
else
|
||||||
|
netdev = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
process_mount(list, args, from, to, fst, opts, netdev);
|
process_mount(list, args, from, to, fst, opts, netdev);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user