From: Kay Sievers Date: Fri, 23 Mar 2007 16:18:03 +0000 (+0100) Subject: don't write to sysfs files during test run X-Git-Tag: 174~2013 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2c9a56e0e624ed448aed8ad18460deed63973e1;p=systemd don't write to sysfs files during test run --- diff --git a/udev_rules.c b/udev_rules.c index f8844a84..5078f2d3 100644 --- a/udev_rules.c +++ b/udev_rules.c @@ -861,8 +861,9 @@ try_parent: info("writing '%s' to sysfs file '%s'", value, attr); f = fopen(attr, "w"); if (f != NULL) { - if (fprintf(f, "%s", value) <= 0) - err("error writing ATTR{%s}: %s", attr, strerror(errno)); + if (!udev->test_run) + if (fprintf(f, "%s", value) <= 0) + err("error writing ATTR{%s}: %s", attr, strerror(errno)); fclose(f); } else err("error opening ATTR{%s} for writing: %s", attr, strerror(errno));