diff options
author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2011-04-14 13:25:33 +0300 |
---|---|---|
committer | Kristen Carlson Accardi <kristen@linux.intel.com> | 2011-04-21 14:48:59 -0700 |
commit | b6938bca1eb682bc9054c439973d3a97bbd4806c (patch) | |
tree | 38461a9eb8f1edc2c0962b615fd6acc485aa0744 | |
parent | 4b08fff4376d3a0f20f08e84ab02a4350ae17017 (diff) | |
download | powertop-b6938bca1eb682bc9054c439973d3a97bbd4806c.tar.gz |
style: Catch exceptions as a reference in alsa::start/end_measurement
Catch exceptions as a reference in alsa::start/end_measurement.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
-rw-r--r-- | devices/alsa.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/devices/alsa.cpp b/devices/alsa.cpp index 998f25c..b0bcd3f 100644 --- a/devices/alsa.cpp +++ b/devices/alsa.cpp @@ -101,8 +101,8 @@ void alsa::start_measurement(void) file >> start_active; } file.close(); - } catch (std::ios_base::failure c) { - cout << "Fail\n"; + } catch (std::ios_base::failure &c) { + fprintf(stderr, "%s\n", c.what()); } } @@ -127,7 +127,8 @@ void alsa::end_measurement(void) file >> end_active; } file.close(); - } catch (std::ios_base::failure c) { + } catch (std::ios_base::failure &c) { + fprintf(stderr, "%s\n", c.what()); } @@ -215,4 +216,4 @@ const char * alsa::human_name(void) if (strlen(guilty) > 0) sprintf(temp_buf, "%s (%s)", humanname, guilty); return temp_buf; -}
\ No newline at end of file +} |