From d2c9a56e0e624ed448aed8ad18460deed63973e1 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 23 Mar 2007 17:18:03 +0100 Subject: [PATCH] don't write to sysfs files during test run --- udev_rules.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)); -- 2.39.5