about summary refs log tree commit diff
path: root/src/libnative
diff options
context:
space:
mode:
Diffstat (limited to 'src/libnative')
-rw-r--r--src/libnative/io/file.rs22
-rw-r--r--src/libnative/io/process.rs2
-rw-r--r--src/libnative/io/timer_helper.rs2
-rw-r--r--src/libnative/io/timer_other.rs2
-rw-r--r--src/libnative/io/timer_timerfd.rs4
5 files changed, 15 insertions, 17 deletions
diff --git a/src/libnative/io/file.rs b/src/libnative/io/file.rs
index 53386433d53..acab7ce3a91 100644
--- a/src/libnative/io/file.rs
+++ b/src/libnative/io/file.rs
@@ -118,7 +118,10 @@ impl io::Reader for FileDesc {
 
 impl io::Writer for FileDesc {
     fn write(&mut self, buf: &[u8]) {
-        self.inner_write(buf);
+        match self.inner_write(buf) {
+            Ok(()) => {}
+            Err(e) => { io::io_error::cond.raise(e); }
+        }
     }
 }
 
@@ -276,7 +279,7 @@ impl rtio::RtioFileStream for FileDesc {
                 _ => Ok(())
             }
         };
-        self.seek(orig_pos as i64, io::SeekSet);
+        let _ = self.seek(orig_pos as i64, io::SeekSet);
         return ret;
     }
     #[cfg(unix)]
@@ -383,12 +386,10 @@ impl rtio::RtioFileStream for CFile {
     }
 
     fn pread(&mut self, buf: &mut [u8], offset: u64) -> Result<int, IoError> {
-        self.flush();
-        self.fd.pread(buf, offset)
+        self.flush().and_then(|()| self.fd.pread(buf, offset))
     }
     fn pwrite(&mut self, buf: &[u8], offset: u64) -> Result<(), IoError> {
-        self.flush();
-        self.fd.pwrite(buf, offset)
+        self.flush().and_then(|()| self.fd.pwrite(buf, offset))
     }
     fn seek(&mut self, pos: i64, style: io::SeekStyle) -> Result<u64, IoError> {
         let whence = match style {
@@ -412,16 +413,13 @@ impl rtio::RtioFileStream for CFile {
         }
     }
     fn fsync(&mut self) -> Result<(), IoError> {
-        self.flush();
-        self.fd.fsync()
+        self.flush().and_then(|()| self.fd.fsync())
     }
     fn datasync(&mut self) -> Result<(), IoError> {
-        self.flush();
-        self.fd.fsync()
+        self.flush().and_then(|()| self.fd.fsync())
     }
     fn truncate(&mut self, offset: i64) -> Result<(), IoError> {
-        self.flush();
-        self.fd.truncate(offset)
+        self.flush().and_then(|()| self.fd.truncate(offset))
     }
 }
 
diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs
index ee4ee295055..13dd4298777 100644
--- a/src/libnative/io/process.rs
+++ b/src/libnative/io/process.rs
@@ -486,7 +486,7 @@ fn spawn_process_os(prog: &str, args: &[~str],
                 (errno <<  8) as u8,
                 (errno <<  0) as u8,
             ];
-            output.inner_write(bytes);
+            assert!(output.inner_write(bytes).is_ok());
             intrinsics::abort();
         })
     }
diff --git a/src/libnative/io/timer_helper.rs b/src/libnative/io/timer_helper.rs
index 9fc18220386..74759b467d4 100644
--- a/src/libnative/io/timer_helper.rs
+++ b/src/libnative/io/timer_helper.rs
@@ -101,7 +101,7 @@ mod imp {
     }
 
     pub fn signal(fd: libc::c_int) {
-        FileDesc::new(fd, false).inner_write([0]);
+        FileDesc::new(fd, false).inner_write([0]).unwrap();
     }
 
     pub fn close(fd: libc::c_int) {
diff --git a/src/libnative/io/timer_other.rs b/src/libnative/io/timer_other.rs
index 4a62a400c8d..bc005f2fe8d 100644
--- a/src/libnative/io/timer_other.rs
+++ b/src/libnative/io/timer_other.rs
@@ -187,7 +187,7 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
 
                 // drain the file descriptor
                 let mut buf = [0];
-                fd.inner_read(buf);
+                fd.inner_read(buf).unwrap();
             }
 
             -1 if os::errno() == libc::EINTR as int => {}
diff --git a/src/libnative/io/timer_timerfd.rs b/src/libnative/io/timer_timerfd.rs
index 2bcaf4d5c7c..1888b8578a0 100644
--- a/src/libnative/io/timer_timerfd.rs
+++ b/src/libnative/io/timer_timerfd.rs
@@ -98,7 +98,7 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
             if fd == input {
                 let mut buf = [0, ..1];
                 // drain the input file descriptor of its input
-                FileDesc::new(fd, false).inner_read(buf);
+                FileDesc::new(fd, false).inner_read(buf).unwrap();
                 incoming = true;
             } else {
                 let mut bits = [0, ..8];
@@ -106,7 +106,7 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
                 //
                 // FIXME: should this perform a send() this number of
                 //      times?
-                FileDesc::new(fd, false).inner_read(bits);
+                FileDesc::new(fd, false).inner_read(bits).unwrap();
                 let remove = {
                     match map.find(&fd).expect("fd unregistered") {
                         &(ref c, oneshot) => !c.try_send(()) || oneshot