This avoids a problem I was having on UbuntuMate 18.0.4 (installed on a Pi3) where a "loop" device existed for each snap package (e.g. loop0, loop1, etc.). There were 2500+ "loop" devices, which filled up the tmp array in get_drives way beyond MAX_DEVICE_NUM, and caused a "stack smashing" error.
I could be wrong, but I don't think the cameras would ever have a name that starts with "loop", so I think this should be a valid solution.
Another option might be to raise MAX_DEVICE_NUM to 10000+, which is probably pretty safe (this was a fresh install of UbuntuMate, so I don't know how many snap packages would be installed in the long run).
This avoids a problem I was having on UbuntuMate 18.0.4 (installed on a Pi3) where a "loop" device existed for each snap package (e.g. loop0, loop1, etc.). There were 2500+ "loop" devices, which filled up the tmp array in get_drives way beyond MAX_DEVICE_NUM, and caused a "stack smashing" error.
I could be wrong, but I don't think the cameras would ever have a name that starts with "loop", so I think this should be a valid solution.
Another option might be to raise MAX_DEVICE_NUM to 10000+, which is probably pretty safe (this was a fresh install of UbuntuMate, so I don't know how many snap packages would be installed in the long run).