summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-03-23 17:18:03 +0100
committerKay Sievers <kay.sievers@vrfy.org>2007-03-23 17:18:03 +0100
commitd2c9a56e0e624ed448aed8ad18460deed63973e1 (patch)
tree37c2023ed655db88a1394a746e9f40f154d0a074
parentbe8594ab14f15203fcea4b2aa0115171472f3e43 (diff)
don't write to sysfs files during test run
-rw-r--r--udev_rules.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/udev_rules.c b/udev_rules.c
index f8844a8438..5078f2d3d1 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));