]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux-uml/linux-uml-2.4.26/unbreak-hostfs.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux-uml / linux-uml-2.4.26 / unbreak-hostfs.patch
1
2 #
3 # Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
4 #
5
6 --- linux-2.4.26/arch/um/fs/hostfs/externfs.c~unbreak-hostfs    2004-05-18 22:01:16.000000000 +0200
7 +++ linux-2.4.26/arch/um/fs/hostfs/externfs.c   2004-05-18 22:43:11.000000000 +0200
8 @@ -1133,7 +1133,7 @@
9         if((mount_arg != NULL) && (*mount_arg != '\0'))
10                 root = mount_arg;
11  
12 -       return(uml_strdup(mount_arg));
13 +       return(uml_strdup(root));
14  }
15  
16  struct super_block *hostfs_read_super(struct super_block *sb, void *data, 
17 --- linux-2.4.26/arch/um/fs/hostfs/host_file.c~unbreak-hostfs   2004-05-18 22:01:16.000000000 +0200
18 +++ linux-2.4.26/arch/um/fs/hostfs/host_file.c  2004-05-18 22:45:17.000000000 +0200
19 @@ -72,28 +72,21 @@
20  {
21         char tmp[HOSTFS_BUFSIZE], *file;
22         int mode = 0, err;
23 +       struct openflags flags = OPENFLAGS();
24  
25 -       if(r && !w) 
26 -               mode = O_RDONLY;
27 -       else if(!r && w) 
28 -               mode = O_WRONLY;
29 -       else if(r && w) 
30 -               mode = O_RDWR;
31 -       else {
32 -               printk("Impossible mode in host_open_file - r = %d, w = %d", 
33 -                      r, w);
34 -               return(-EINVAL);
35 -       }
36 -
37 +       if (r)
38 +               flags = of_read(flags);
39 +       if (w)
40 +               flags = of_write(flags);
41         if(append)
42 -               mode |= O_APPEND;
43 +               flags = of_append(flags);
44  
45         err = -ENOMEM;
46         file = get_path(path, tmp, sizeof(tmp));
47         if(file == NULL)
48                 goto out;
49         
50 -       err = open_filehandle(file, of_create(of_rdwr(OPENFLAGS())), mode, fh);
51 +       err = open_filehandle(file, flags, 0, fh);
52   out:
53         free_path(file, tmp);
54         return(err);
55 --- linux-2.4.26/arch/um/fs/hostfs/host_fs.c~unbreak-hostfs     2004-05-18 22:01:16.000000000 +0200
56 +++ linux-2.4.26/arch/um/fs/hostfs/host_fs.c    2004-05-18 22:50:11.000000000 +0200
57 @@ -111,10 +111,13 @@
58  {
59         const char *path[] = { jail_dir, mount, file, NULL };
60         int uid;
61 +       int gid;
62 +       int rc;
63  
64         *uid_out = 0;
65 +       *gid_out = 0;
66         return(host_stat_file(path, dev_out, inode_out, mode_out, nlink_out, 
67 -                             &uid, gid_out, size_out, atime_out, mtime_out, 
68 +                             &uid, &gid, size_out, atime_out, mtime_out, 
69                               ctime_out, blksize_out, blocks_out));
70  }
71  
72 @@ -138,6 +141,12 @@
73                 goto out;
74  
75         err = host_open_file(path, 1, 1, fh);
76 +       if (err == -EISDIR) {
77 +               kfree(fh);
78 +               return NULL;
79 +       }
80 +       if (err == -EPERM)
81 +               err = host_open_file(path, 1, 0, fh);
82         if(err)
83                 goto out_free;
84  
85 @@ -175,10 +184,9 @@
86                                 len - ignore_end);
87  
88   out:
89 -       if(err < 0)
90 -               (*completion)(buf, err, arg);
91 -       else err = 0;
92 -
93 +       (*completion)(buf, err, arg);
94 +       if (err > 0)
95 +               err = 0;
96         return(err);
97  }
98  
99 @@ -191,8 +199,9 @@
100  
101         err = write_file(fh, offset + start, buf + start, len);
102  
103 -       if(err < 0)
104 -               (*completion)((char *) buf, err, arg);
105 +       (*completion)((char *) buf, err, arg);
106 +       if (err > 0)
107 +               err = 0;
108         return(err);
109  }
110