Commit 9bd5d697 authored by Jeremy Soller's avatar Jeremy Soller

Compatibility with new kernel

parent 11f34851
......@@ -2,8 +2,7 @@ use std::fs::{File, OpenOptions};
use std::io::{Read, Write, Seek, SeekFrom};
use redoxfs::Disk;
use system::error::{Error, Result, EIO};
use syscall::error::{Error, Result, EIO};
macro_rules! try_disk {
($expr:expr) => (match $expr {
......
......@@ -2,7 +2,7 @@
extern crate fuse;
extern crate redoxfs;
extern crate system;
extern crate syscall;
extern crate time;
use image::Image;
......
......@@ -48,10 +48,11 @@ fn main() {
let scheme = FileScheme::new(fs);
loop {
let mut packet = Packet::default();
while socket.read(&mut packet).unwrap() == size_of::<Packet>() {
scheme.handle(&mut packet);
socket.write(&packet).unwrap();
}
socket.read(&mut packet).unwrap();
println!("file: {:?}", packet);
scheme.handle(&mut packet);
println!("file: ={}", packet.a);
socket.write(&packet).unwrap();
}
},
Err(err) => println!("redoxfs: failed to create file scheme: {}", err)
......
......@@ -14,7 +14,7 @@ pub struct FileSystem {
impl FileSystem {
/// Open a file system on a disk
pub fn open(mut disk: Box<Disk>) -> Result<Self> {
for block in 0..8192 {
for block in 0..65536 {
let mut header = (0, Header::default());
try!(disk.read_at(block + header.0, &mut header.1));
......
......@@ -2,8 +2,7 @@ use std::fs::{File, OpenOptions};
use std::io::{Read, Write, Seek, SeekFrom};
use redoxfs::Disk;
use system::error::{Error, Result, EIO};
use syscall::error::{Error, Result, EIO};
macro_rules! try_disk {
($expr:expr) => (match $expr {
......
#![deny(warnings)]
extern crate redoxfs;
extern crate system;
extern crate syscall;
use std::env;
use std::io::{self, Write};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment