From fe9338c94b206e272cb4df77635e710cb0e19024 Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Sat, 15 Dec 2018 01:00:26 +0100 Subject: [PATCH] ihdad: Implement fpath Fixes the output of sys:/iostat. The correct implementation is TODO like most of the scheme related code in this driver. --- ihdad/src/HDA/device.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ihdad/src/HDA/device.rs b/ihdad/src/HDA/device.rs index 64774ea760..567933730a 100755 --- a/ihdad/src/HDA/device.rs +++ b/ihdad/src/HDA/device.rs @@ -992,7 +992,7 @@ impl SchemeMut for IntelHDA { // TODO: if uid == 0 { - Ok(flags) + Ok(0) } else { Err(Error::new(EACCES)) } @@ -1030,4 +1030,16 @@ impl SchemeMut for IntelHDA { handles.remove(&_id).ok_or(Error::new(EBADF)).and(Ok(0)) } + fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result { + //let mut handles = self.handles.lock(); + //let handle = handles.get_mut(&id).ok_or(Error::new(EBADF))?; + + let mut i = 0; + let scheme_path = b"audio:"; + while i < buf.len() && i < scheme_path.len() { + buf[i] = scheme_path[i]; + i += 1; + } + Ok(i) + } }