From a8e505baba4a7cabc01aa7a7b87e84c9dfc62eb6 Mon Sep 17 00:00:00 2001 From: Jarkko Sakkinen Date: Thu, 10 Mar 2011 02:57:07 -0800 Subject: [PATCH] Fix: update mtime for global_rules. --- src/smack.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/smack.c b/src/smack.c index cb0811d..fbbfd71 100644 --- a/src/smack.c +++ b/src/smack.c @@ -91,13 +91,13 @@ static int refresh_global_rules(const char *path) goto out; } - if (global_rules != NULL) { - ret = stat(path, &sb); - if (ret) { - result = -1; - goto out; - } + ret = stat(path, &sb); + if (ret) { + result = -1; + goto out; + } + if (global_rules != NULL) { if (global_rules_path == NULL || strcmp(path, global_rules_path) != 0 || sb.st_mtime != global_rules_mtime) @@ -105,6 +105,8 @@ static int refresh_global_rules(const char *path) } if (global_rules == NULL) { + global_rules_mtime = sb.st_mtime; + global_rules_path = strdup(path); if (global_rules_path == NULL) { result = -1; -- 2.7.4