test: don't fail if setting /sys as a slave mount doesn't succeed

Maybe it's not mounted in the first place. We could be running in a chroot
without /sys mounted, etc.

Also, the error message was wrong.
This commit is contained in:
Lubomir Rintel 2015-10-31 22:36:07 +01:00
parent ea00693b00
commit 6e5fbf096a

View file

@ -878,10 +878,7 @@ main (int argc, char **argv)
/* Mount our /sys instance, so that gudev sees only our devices.
* Needs to be read-only, because we don't run udev. */
if (mount (NULL, "/sys", "sysfs", MS_SLAVE, NULL) != 0) {
errsv = errno;
g_error ("mount(\"/\", MS_SLAVE) failed with %s (%d)", strerror (errsv), errsv);
}
mount (NULL, "/sys", "sysfs", MS_SLAVE, NULL);
if (mount ("sys", "/sys", "sysfs", MS_RDONLY, NULL) != 0) {
errsv = errno;
g_error ("mount(\"/sys\") failed with %s (%d)", strerror (errsv), errsv);