chiark / gitweb /
don't write to sysfs files during test run
authorKay Sievers <kay.sievers@vrfy.org>
Fri, 23 Mar 2007 16:18:03 +0000 (17:18 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Fri, 23 Mar 2007 16:18:03 +0000 (17:18 +0100)
udev_rules.c

index f8844a8438df8af7ae277c248489ece37d145d7e..5078f2d3d1668a6e4d80b9eb487c9c324234c0c7 100644 (file)
@@ -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));