diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-08-08 05:07:36 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-08-08 05:07:36 +0200 |
commit | 63cc8f049100c9b76ca4e37fc5c8976b6e92a207 (patch) | |
tree | 7816e16d6e6239f7ee8222015fdb26a09f60d2f4 /udev_rules_parse.c | |
parent | 13d11705bf0117365afc3f9210f4d568a2baa69c (diff) |
allow clean shutdown of udevd
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_rules_parse.c')
-rw-r--r-- | udev_rules_parse.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/udev_rules_parse.c b/udev_rules_parse.c index 4580a779c6..cededf002d 100644 --- a/udev_rules_parse.c +++ b/udev_rules_parse.c @@ -650,10 +650,12 @@ int udev_rules_init(struct udev_rules *rules, int resolve_names) void udev_rules_close(struct udev_rules *rules) { - if (rules->mapped) - file_unmap(rules->buf, rules->bufsize); - else - free(rules->buf); - - rules->buf = NULL; + if (rules->buf) { + if (rules->mapped) { + rules->mapped = 0; + file_unmap(rules->buf, rules->bufsize); + } else + free(rules->buf); + rules->buf = NULL; + } } |