From 436eedd6d401fb8802a4f86330c61c544a8c2093 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 31 Aug 1998 10:05:42 +0000 Subject: [PATCH] Unneccessary code removal --- vfs/extfs.c | 74 ++++++++-------------------------------------------- vfs/ftpfs.c | 50 +++++------------------------------ vfs/libvfs.c | 2 ++ vfs/tar.c | 72 +++++++------------------------------------------- 4 files changed, 30 insertions(+), 168 deletions(-) diff --git a/vfs/extfs.c b/vfs/extfs.c index 317b26793..ca5bb5109 100644 --- a/vfs/extfs.c +++ b/vfs/extfs.c @@ -746,21 +746,6 @@ static int extfs_chmod (char *path, int mode) return 0; } -static int extfs_chown (char *path, int owner, int group) -{ - return -1; -} - -static int extfs_unlink (char *path) -{ - return -1; -} - -static int extfs_symlink (char *n1, char *n2) -{ - return -1; -} - static int extfs_write (void *data, char *buf, int nbyte) { struct extfs_pseudofile *file = (struct extfs_pseudofile *)data; @@ -769,11 +754,6 @@ static int extfs_write (void *data, char *buf, int nbyte) return write (file->local_handle, buf, nbyte); } -static int extfs_rename (char *a, char *b) -{ - return -1; -} - static int extfs_chdir (char *path) { struct extfs_archive *archive; @@ -807,26 +787,6 @@ static int extfs_lseek (void *data, off_t offset, int whence) return lseek (file->local_handle, offset, whence); } -static int extfs_mknod (char *path, int mode, int dev) -{ - return -1; -} - -static int extfs_link (char *p1, char *p2) -{ - return -1; -} - -static int extfs_mkdir (char *path, mode_t mode) -{ - return -1; -} - -static int extfs_rmdir (char *path) -{ - return -1; -} - static vfsid extfs_getid (char *path, struct vfs_stamping **parent) { struct extfs_archive *archive; @@ -940,18 +900,6 @@ static void extfs_ungetlocalcopy (char *path, char *local, int has_changed) } } -#ifdef HAVE_MMAP -caddr_t extfs_mmap (caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset) -{ - return (caddr_t)-1; -} - -int extfs_munmap (caddr_t addr, size_t len, void *data) -{ - return -1; -} -#endif - vfs extfs_vfs_ops = { extfs_open, @@ -969,21 +917,21 @@ vfs extfs_vfs_ops = s_lstat, s_fstat, - extfs_chmod, /* unimplemented */ - extfs_chown, /* unimplemented */ + extfs_chmod, /* chmod ... strange, returns success? */ + NULL, NULL, s_readlink, - extfs_symlink, /* unimplemented */ - extfs_link, /* unimplemented */ - extfs_unlink, /* unimplemented */ + NULL, /* symlink */ + NULL, + NULL, - extfs_rename, /* unimplemented */ + NULL, extfs_chdir, s_errno, extfs_lseek, - extfs_mknod, /* unimplemented */ + NULL, extfs_getid, extfs_nothingisopen, @@ -992,15 +940,15 @@ vfs extfs_vfs_ops = extfs_getlocalcopy, extfs_ungetlocalcopy, - extfs_mkdir, /* unimplemented */ - extfs_rmdir, /* unimplemented */ + NULL, /* mkdir */ + NULL, NULL, NULL, NULL #ifdef HAVE_MMAP - , extfs_mmap, - extfs_munmap + , NULL, + NULL #endif }; diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index a1a698d94..5b1e4ebbe 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -2420,18 +2420,6 @@ static int ftpfs_unlink (char *path) return send_ftp_command(path, "DELE %s", 1); } -static int ftpfs_symlink (char *n1, char *n2) -{ - ftpfserrno = EPERM; - return -1; -} - -static int ftpfs_rename (char *path1, char *path2) -{ - ftpfserrno = EPERM; - return -1; -} - static int __ftpfs_chdir (struct ftpfs_connection *bucket ,char *remote_path) { @@ -2475,12 +2463,6 @@ static int ftpfs_lseek (void *data, off_t offset, int whence) return lseek(fp->local_handle, offset, whence); } -static int ftpfs_mknod (char *path, int mode, int dev) -{ - ftpfserrno = EPERM; - return -1; -} - static int ftpfs_mkdir (char *path, mode_t mode) { return send_ftp_command(path, "MKD %s", 1); @@ -2491,12 +2473,6 @@ static int ftpfs_rmdir (char *path) return send_ftp_command(path, "RMD %s", 1); } -static int ftpfs_link (char *p1, char *p2) -{ - ftpfserrno = EPERM; - return -1; -} - static vfsid ftpfs_getid (char *p, struct vfs_stamping **parent) { struct ftpfs_connection *bucket; @@ -2617,18 +2593,6 @@ void ftpfs_forget (char *file) wipe_password (pass); } -#ifdef HAVE_MMAP -caddr_t ftpfs_mmap (caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset) -{ - return (caddr_t)-1; /* We do not mmap to far away */ -} - -int ftpfs_munmap (caddr_t addr, size_t len, void *data) -{ - return -1; -} -#endif - vfs ftpfs_vfs_ops = { ftpfs_open, ftpfs_close, @@ -2646,19 +2610,19 @@ vfs ftpfs_vfs_ops = { ftpfs_fstat, ftpfs_chmod, - ftpfs_chown, + ftpfs_chown, /* not really implemented but returns success */ NULL, ftpfs_readlink, - ftpfs_symlink, - ftpfs_link, + NULL, + NULL, ftpfs_unlink, - ftpfs_rename, + NULL, ftpfs_chdir, ftpfs_errno, ftpfs_lseek, - ftpfs_mknod, + NULL, ftpfs_getid, ftpfs_nothingisopen, @@ -2673,8 +2637,8 @@ vfs ftpfs_vfs_ops = { ftpfs_setctl, ftpfs_forget #ifdef HAVE_MMAP - , ftpfs_mmap, - ftpfs_munmap + , NULL, + NULL #endif }; diff --git a/vfs/libvfs.c b/vfs/libvfs.c index 8468d26df..2d9fc1635 100644 --- a/vfs/libvfs.c +++ b/vfs/libvfs.c @@ -10,6 +10,8 @@ void vfs_init( void ); void ftpfs_init_passwd( void ); +char *mc_home = LIBDIR; + void mc_vfs_init( void ) { diff --git a/vfs/tar.c b/vfs/tar.c index 1e66d7731..430dd20fa 100644 --- a/vfs/tar.c +++ b/vfs/tar.c @@ -1067,26 +1067,6 @@ static int tar_chown (char *path, int owner, int group) return chown (path, owner, group); } -static int tar_unlink (char *path) -{ - return -1; -} - -static int tar_symlink (char *n1, char *n2) -{ - return -1; -} - -static int tar_write (void *data, char *buf, int nbyte) -{ - return -1; -} - -static int tar_rename (char *a, char *b) -{ - return -1; -} - static int tar_chdir (char *path) { struct tarfs_archive *archive; @@ -1126,26 +1106,6 @@ static int tar_lseek (void *data, off_t offset, int whence) return file->pos; } -static int tar_mknod (char *path, int mode, int dev) -{ - return -1; -} - -static int tar_link (char *p1, char *p2) -{ - return -1; -} - -static int tar_mkdir (char *path, mode_t mode) -{ - return -1; -} - -static int tar_rmdir (char *path) -{ - return -1; -} - static vfsid tar_getid (char *path, struct vfs_stamping **parent) { struct tarfs_archive *archive; @@ -1251,24 +1211,12 @@ static void tar_ungetlocalcopy (char *path, char *local, int has_changed) since it will be freed when tar archive will be freed */ } -#ifdef HAVE_MMAP -caddr_t tar_mmap (caddr_t addr, size_t len, int prot, int flags, void *data, off_t offset) -{ - return (caddr_t)-1; -} - -int tar_munmap (caddr_t addr, size_t len, void *data) -{ - return -1; -} -#endif - vfs tarfs_vfs_ops = { tar_open, tar_close, tar_read, - tar_write, /* unimplemented */ + NULL, s_opendir, s_readdir, @@ -1285,15 +1233,15 @@ vfs tarfs_vfs_ops = NULL, s_readlink, - tar_symlink, /* unimplemented */ - tar_link, /* unimplemented */ - tar_unlink, /* unimplemented */ + NULL, + NULL, + NULL, - tar_rename, /* unimplemented */ + NULL, tar_chdir, s_errno, tar_lseek, - tar_mknod, /* unipmelemented */ + NULL, tar_getid, tar_nothingisopen, @@ -1302,13 +1250,13 @@ vfs tarfs_vfs_ops = tar_getlocalcopy, tar_ungetlocalcopy, - tar_mkdir, /* unimplemented */ - tar_rmdir, /* unimplemented */ + NULL, /* mkdir */ + NULL, NULL, NULL, NULL #ifdef HAVE_MMAP - , tar_mmap, /* unimplemented */ - tar_munmap /* unimplemented */ + , NULL, + NULL #endif };