|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
diff -up mc-4.7.0/vfs/vfs.c.jn mc-4.7.0/vfs/vfs.c
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
--- mc-4.7.0/vfs/vfs.c.jn 2009-10-12 13:57:18.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+++ mc-4.7.0/vfs/vfs.c 2009-10-12 14:34:04.000000000 +0200
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
@@ -675,6 +675,9 @@ int
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
mc_ctl (int handle, int ctlop, void *arg)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
{
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
struct vfs_class *vfs = vfs_op (handle);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ if (vfs == NULL)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ return 0;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
return vfs->ctl ? (*vfs->ctl)(vfs_info (handle), ctlop, arg) : 0;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
}
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
@@ -708,6 +711,10 @@ mc_close (int handle)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
return -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
vfs = vfs_op (handle);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ if (vfs == NULL)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ return -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
if (handle < 3)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
return close (handle);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
@@ -798,6 +805,8 @@ mc_readdir (DIR *dirp)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
}
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
handle = *(int *) dirp;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
vfs = vfs_op (handle);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ if (vfs == NULL)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ return NULL;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
dirinfo = vfs_info (handle);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
if (vfs->readdir) {
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
entry = (*vfs->readdir) (dirinfo->info);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
@@ -820,6 +829,9 @@ mc_closedir (DIR *dirp)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
int result;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
struct vfs_dirinfo *dirinfo;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ if (vfs == NULL)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ return -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
dirinfo = vfs_info (handle);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
if (dirinfo->converter != str_cnv_from_term) str_close_conv (dirinfo->converter);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
@@ -874,6 +886,8 @@ int mc_fstat (int handle, struct stat *b
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
if (handle == -1)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
return -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
vfs = vfs_op (handle);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ if (vfs == NULL)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ return -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
result = vfs->fstat ? (*vfs->fstat) (vfs_info (handle), buf) : -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
if (result == -1)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
errno = vfs->name ? ferrno (vfs) : E_NOTSUPP;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
@@ -967,6 +981,8 @@ off_t mc_lseek (int fd, off_t offset, in
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
return -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
vfs = vfs_op (fd);
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ if (vfs == NULL)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
+ return -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
result = vfs->lseek ? (*vfs->lseek)(vfs_info (fd), offset, whence) : -1;
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
if (result == -1)
|
|
![](https://seccdn.libravatar.org/avatar/9567c565725defb09e8ebcb659652d98fe8255445711ee66167dff84e71984a8?s=16&d=retro) |
39c933c |
errno = vfs->lseek ? ferrno (vfs) : E_NOTSUPP;
|