summary refs log tree commit diff
path: root/sys_util/src/sock_ctrl_msg.rs
diff options
context:
space:
mode:
Diffstat (limited to 'sys_util/src/sock_ctrl_msg.rs')
-rw-r--r--sys_util/src/sock_ctrl_msg.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys_util/src/sock_ctrl_msg.rs b/sys_util/src/sock_ctrl_msg.rs
index 545e1f2..8a3ce39 100644
--- a/sys_util/src/sock_ctrl_msg.rs
+++ b/sys_util/src/sock_ctrl_msg.rs
@@ -154,7 +154,7 @@ impl Scm {
         };
 
         if write_count < 0 {
-            Err(Error::new(write_count as i32))
+            Err(Error::new(-write_count as i32))
         } else {
             Ok(write_count as usize)
         }
@@ -201,7 +201,7 @@ impl Scm {
         };
 
         if read_count < 0 {
-            Err(Error::new(read_count as i32))
+            Err(Error::new(-read_count as i32))
         } else {
             // Safe because we have unqiue ownership of each fd we wrap with File.
             for &fd in &self.fds[0..fd_count] {