commit | 48f1545448c2192d25e15360f1edcbe8e1974cd2 | [log] [tgz] |
---|---|---|
author | Dominik Brodowski <linux@dominikbrodowski.net> | Thu Apr 29 18:02:18 2010 +0200 |
committer | Dominik Brodowski <linux@dominikbrodowski.net> | Thu Apr 29 18:02:18 2010 +0200 |
tree | fa8179b6c86c8c95fc740460f3ab07adb6506bbe | |
parent | e67a8350da61353ed744d2e39d344ec80d1a3c23 [diff] |
aperf: fail early if user may not access MSR. Based on a suggestion by Thomas Renninger. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
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 @@ 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;