diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-04-29 18:02:18 +0200 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-04-29 18:02:18 +0200 |
commit | 48f1545448c2192d25e15360f1edcbe8e1974cd2 (patch) | |
tree | fa8179b6c86c8c95fc740460f3ab07adb6506bbe | |
parent | e67a8350da61353ed744d2e39d344ec80d1a3c23 (diff) | |
download | cpufrequtils-48f1545448c2192d25e15360f1edcbe8e1974cd2.tar.gz |
aperf: fail early if user may not access MSR.
Based on a suggestion by Thomas Renninger.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r-- | utils/aperf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/aperf.c b/utils/aperf.c index 893e8eb..063f4a4 100644 --- a/utils/aperf.c +++ b/utils/aperf.c @@ -403,7 +403,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - ret = access(msr_path, F_OK); + ret = access(msr_path, R_OK); if (ret < 0) { fprintf(stderr, "Error reading %s, load/enable msr.ko\n", msr_path); goto out; |