Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
fix for util on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
debris committed Aug 1, 2017
1 parent a2c0512 commit 0f5d5e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/src/kvdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ impl Default for CompactionProfile {
/// Given output of df command return Linux rotational flag file path.
#[cfg(target_os = "linux")]
pub fn rotational_from_df_output(df_out: Vec<u8>) -> Option<PathBuf> {
use std::io::Read;
str::from_utf8(df_out.as_slice())
.ok()
// Get the drive name.
Expand All @@ -324,6 +325,7 @@ impl CompactionProfile {
/// Attempt to determine the best profile automatically, only Linux for now.
#[cfg(target_os = "linux")]
pub fn auto(db_path: &Path) -> CompactionProfile {
use std::io::Read;
let hdd_check_file = db_path
.to_str()
.and_then(|path_str| Command::new("df").arg(path_str).output().ok())
Expand Down

0 comments on commit 0f5d5e7

Please sign in to comment.