* *.c: Declared unused variables with (void) to avoid the gcc
warnings. * extfs.c (extfs_get_path_mangle, extfs_get_path): Removed unused parameter. * ftpfs.c (ftpfs_netrc_bad_mode): Likewise. * vfs.c (mc_def_getlocalcopy): Likewise.
Этот коммит содержится в:
родитель
c2d0ec2f5f
Коммит
d7e7ec48dd
@ -1,3 +1,12 @@
|
||||
2005-02-22 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* *.c: Declared unused variables with (void) to avoid the gcc
|
||||
warnings.
|
||||
* extfs.c (extfs_get_path_mangle, extfs_get_path): Removed unused
|
||||
parameter.
|
||||
* ftpfs.c (ftpfs_netrc_bad_mode): Likewise.
|
||||
* vfs.c (mc_def_getlocalcopy): Likewise.
|
||||
|
||||
2005-02-19 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* utilvfs.h: Removed unneeded #includes.
|
||||
|
15
vfs/cpio.c
15
vfs/cpio.c
@ -134,6 +134,9 @@ static int cpio_skip_padding(struct vfs_s_super *super)
|
||||
static void cpio_free_archive(struct vfs_class *me, struct vfs_s_super *super)
|
||||
{
|
||||
struct defer_inode *l, *lnext;
|
||||
|
||||
(void) me;
|
||||
|
||||
if(super->u.arch.fd != -1)
|
||||
mc_close(super->u.arch.fd);
|
||||
super->u.arch.fd = -1;
|
||||
@ -565,6 +568,8 @@ cpio_open_archive (struct vfs_class *me, struct vfs_s_super *super,
|
||||
{
|
||||
int status = STATUS_START;
|
||||
|
||||
(void) op;
|
||||
|
||||
if (cpio_open_cpio_file (me, super, name) == -1)
|
||||
return -1;
|
||||
|
||||
@ -591,6 +596,10 @@ static void *
|
||||
cpio_super_check (struct vfs_class *me, const char *archive_name, char *op)
|
||||
{
|
||||
static struct stat sb;
|
||||
|
||||
(void) me;
|
||||
(void) op;
|
||||
|
||||
if (mc_stat (archive_name, &sb))
|
||||
return NULL;
|
||||
return &sb;
|
||||
@ -602,6 +611,9 @@ cpio_super_same (struct vfs_class *me, struct vfs_s_super *parc,
|
||||
{
|
||||
struct stat *archive_stat = cookie; /* stat of main archive */
|
||||
|
||||
(void) me;
|
||||
(void) op;
|
||||
|
||||
if (strcmp (parc->name, archive_name))
|
||||
return 0;
|
||||
|
||||
@ -636,6 +648,9 @@ static int cpio_read(void *fh, char *buffer, int count)
|
||||
|
||||
static int cpio_fh_open(struct vfs_class *me, struct vfs_s_fh *fh, int flags, int mode)
|
||||
{
|
||||
(void) fh;
|
||||
(void) mode;
|
||||
|
||||
if ((flags & O_ACCMODE) != O_RDONLY) ERRNOR (EROFS, -1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -133,6 +133,8 @@ vfs_s_insert_entry (struct vfs_class *me, struct vfs_s_inode *dir, struct vfs_s_
|
||||
{
|
||||
struct vfs_s_entry **ep;
|
||||
|
||||
(void) me;
|
||||
|
||||
for (ep = &dir->subdir; *ep != NULL; ep = &((*ep)->next))
|
||||
;
|
||||
ent->prevp = ep;
|
||||
@ -149,6 +151,8 @@ vfs_s_default_stat (struct vfs_class *me, mode_t mode)
|
||||
static struct stat st;
|
||||
int myumask;
|
||||
|
||||
(void) me;
|
||||
|
||||
myumask = umask (022);
|
||||
umask (myumask);
|
||||
mode &= ~myumask;
|
||||
@ -293,6 +297,9 @@ static void
|
||||
split_dir_name (struct vfs_class *me, char *path, char **dir, char **name, char **save)
|
||||
{
|
||||
char *s;
|
||||
|
||||
(void) me;
|
||||
|
||||
s = strrchr (path, PATH_SEP);
|
||||
if (!s){
|
||||
*save = NULL;
|
||||
@ -1035,6 +1042,10 @@ static int
|
||||
vfs_s_ungetlocalcopy (struct vfs_class *me, const char *path,
|
||||
const char *local, int has_changed)
|
||||
{
|
||||
(void) me;
|
||||
(void) path;
|
||||
(void) local;
|
||||
(void) has_changed;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1084,7 +1095,8 @@ vfs_s_getid (struct vfs_class *me, const char *path)
|
||||
static int
|
||||
vfs_s_nothingisopen (vfsid id)
|
||||
{
|
||||
/* Our data structures should survive free of superblock at any time */
|
||||
(void) id;
|
||||
/* Our data structures should survive free of superblock at any time */
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1194,6 +1206,8 @@ vfs_s_get_line_interruptible (struct vfs_class *me, char *buffer, int size, int
|
||||
int n;
|
||||
int i;
|
||||
|
||||
(void) me;
|
||||
|
||||
enable_interrupt_key ();
|
||||
for (i = 0; i < size-1; i++){
|
||||
n = read (fd, buffer+i, 1);
|
||||
|
44
vfs/extfs.c
44
vfs/extfs.c
@ -113,6 +113,8 @@ extfs_fill_names (struct vfs_class *me, fill_names_f func)
|
||||
struct archive *a = first_archive;
|
||||
char *name;
|
||||
|
||||
(void) me;
|
||||
|
||||
while (a) {
|
||||
name =
|
||||
g_strconcat (a->name ? a->name : "", "#",
|
||||
@ -196,6 +198,7 @@ static struct entry *extfs_generate_entry (struct archive *archive,
|
||||
|
||||
static void extfs_free_entries (struct entry *entry)
|
||||
{
|
||||
(void) entry;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -432,7 +435,7 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
|
||||
* can be changed and the result may point inside the original string.
|
||||
*/
|
||||
static char *
|
||||
extfs_get_path_mangle (struct vfs_class *me, char *inname, struct archive **archive, int is_dir,
|
||||
extfs_get_path_mangle (struct vfs_class *me, char *inname, struct archive **archive,
|
||||
int do_not_open)
|
||||
{
|
||||
char *local, *op;
|
||||
@ -480,11 +483,11 @@ extfs_get_path_mangle (struct vfs_class *me, char *inname, struct archive **arch
|
||||
* The result should be freed.
|
||||
*/
|
||||
static char *
|
||||
extfs_get_path (struct vfs_class *me, const char *inname, struct archive **archive, int is_dir,
|
||||
extfs_get_path (struct vfs_class *me, const char *inname, struct archive **archive,
|
||||
int do_not_open)
|
||||
{
|
||||
char *buf = g_strdup (inname);
|
||||
char *res = extfs_get_path_mangle (me, buf, archive, is_dir, do_not_open);
|
||||
char *res = extfs_get_path_mangle (me, buf, archive, do_not_open);
|
||||
char *res2 = NULL;
|
||||
if (res)
|
||||
res2 = g_strdup (res);
|
||||
@ -636,7 +639,7 @@ extfs_run (struct vfs_class *me, const char *file)
|
||||
char *p, *q, *archive_name, *mc_extfsdir;
|
||||
char *cmd;
|
||||
|
||||
if ((p = extfs_get_path (me, file, &archive, 0, 0)) == NULL)
|
||||
if ((p = extfs_get_path (me, file, &archive, 0)) == NULL)
|
||||
return;
|
||||
q = name_quote (p, 0);
|
||||
g_free (p);
|
||||
@ -662,7 +665,7 @@ extfs_open (struct vfs_class *me, const char *file, int flags, int mode)
|
||||
int local_handle;
|
||||
int created = 0;
|
||||
|
||||
if ((q = extfs_get_path (me, file, &archive, 0, 0)) == NULL)
|
||||
if ((q = extfs_get_path (me, file, &archive, 0)) == NULL)
|
||||
return NULL;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
if (entry == NULL && (flags & O_CREAT)) {
|
||||
@ -855,6 +858,8 @@ static struct entry *extfs_find_entry (struct entry *dir, char *name, int make_d
|
||||
|
||||
static int extfs_errno (struct vfs_class *me)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return my_errno;
|
||||
}
|
||||
|
||||
@ -865,7 +870,7 @@ static void * extfs_opendir (struct vfs_class *me, const char *dirname)
|
||||
struct entry *entry;
|
||||
struct entry **info;
|
||||
|
||||
if ((q = extfs_get_path (me, dirname, &archive, 1, 0)) == NULL)
|
||||
if ((q = extfs_get_path (me, dirname, &archive, 0)) == NULL)
|
||||
return NULL;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
g_free (q);
|
||||
@ -937,7 +942,7 @@ extfs_internal_stat (struct vfs_class *me, const char *path, struct stat *buf,
|
||||
char *path2 = g_strdup (path);
|
||||
int result = -1;
|
||||
|
||||
if ((q = extfs_get_path_mangle (me, path2, &archive, 0, 0)) == NULL)
|
||||
if ((q = extfs_get_path_mangle (me, path2, &archive, 0)) == NULL)
|
||||
goto cleanup;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
if (entry == NULL)
|
||||
@ -979,7 +984,7 @@ extfs_readlink (struct vfs_class *me, const char *path, char *buf, size_t size)
|
||||
char *mpath = g_strdup (path);
|
||||
int result = -1;
|
||||
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0, 0)) == NULL)
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0)) == NULL)
|
||||
goto cleanup;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
if (entry == NULL)
|
||||
@ -1000,6 +1005,9 @@ cleanup:
|
||||
|
||||
static int extfs_chmod (struct vfs_class *me, const char *path, int mode)
|
||||
{
|
||||
(void) me;
|
||||
(void) path;
|
||||
(void) mode;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1018,7 +1026,7 @@ static int extfs_unlink (struct vfs_class *me, const char *file)
|
||||
struct entry *entry;
|
||||
int result = -1;
|
||||
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0, 0)) == NULL)
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0)) == NULL)
|
||||
goto cleanup;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
if (entry == NULL)
|
||||
@ -1047,7 +1055,9 @@ static int extfs_mkdir (struct vfs_class *me, const char *path, mode_t mode)
|
||||
struct entry *entry;
|
||||
int result = -1;
|
||||
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0, 0)) == NULL)
|
||||
(void) mode;
|
||||
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0)) == NULL)
|
||||
goto cleanup;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
if (entry != NULL) {
|
||||
@ -1082,7 +1092,7 @@ static int extfs_rmdir (struct vfs_class *me, const char *path)
|
||||
struct entry *entry;
|
||||
int result = -1;
|
||||
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0, 0)) == NULL)
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0)) == NULL)
|
||||
goto cleanup;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
if (entry == NULL)
|
||||
@ -1113,7 +1123,7 @@ extfs_chdir (struct vfs_class *me, const char *path)
|
||||
struct entry *entry;
|
||||
|
||||
my_errno = ENOTDIR;
|
||||
if ((q = extfs_get_path (me, path, &archive, 1, 0)) == NULL)
|
||||
if ((q = extfs_get_path (me, path, &archive, 0)) == NULL)
|
||||
return -1;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
g_free (q);
|
||||
@ -1139,7 +1149,7 @@ extfs_getid (struct vfs_class *me, const char *path)
|
||||
struct archive *archive;
|
||||
char *p;
|
||||
|
||||
if (!(p = extfs_get_path (me, path, &archive, 1, 1)))
|
||||
if (!(p = extfs_get_path (me, path, &archive, 1)))
|
||||
return NULL;
|
||||
g_free (p);
|
||||
return (vfsid) archive;
|
||||
@ -1279,6 +1289,8 @@ static int extfs_init (struct vfs_class *me)
|
||||
char *mc_extfsini;
|
||||
char key[256];
|
||||
|
||||
(void) me;
|
||||
|
||||
mc_extfsini = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR "extfs.ini");
|
||||
cfg = fopen (mc_extfsini, "r");
|
||||
|
||||
@ -1331,6 +1343,8 @@ static int extfs_which (struct vfs_class *me, const char *path)
|
||||
{
|
||||
int i;
|
||||
|
||||
(void) me;
|
||||
|
||||
for (i = 0; i < extfs_no; i++)
|
||||
if (!strcmp (path, extfs_prefixes [i]))
|
||||
return i;
|
||||
@ -1341,6 +1355,8 @@ static void extfs_done (struct vfs_class *me)
|
||||
{
|
||||
int i;
|
||||
|
||||
(void) me;
|
||||
|
||||
for (i = 0; i < extfs_no; i++ )
|
||||
g_free (extfs_prefixes [i]);
|
||||
extfs_no = 0;
|
||||
@ -1349,6 +1365,8 @@ static void extfs_done (struct vfs_class *me)
|
||||
static int
|
||||
extfs_setctl (struct vfs_class *me, const char *path, int ctlop, void *arg)
|
||||
{
|
||||
(void) arg;
|
||||
|
||||
if (ctlop == VFS_SETCTL_RUN) {
|
||||
extfs_run (me, path);
|
||||
return 1;
|
||||
|
@ -311,6 +311,8 @@ fish_open_archive (struct vfs_class *me, struct vfs_s_super *super,
|
||||
char *host, *user, *password, *p;
|
||||
int flags;
|
||||
|
||||
(void) archive_name;
|
||||
|
||||
p = vfs_split_url (strchr (op, ':') + 1, &host, &user, &flags,
|
||||
&password, 0, URL_NOSLASH);
|
||||
|
||||
@ -334,6 +336,10 @@ fish_archive_same (struct vfs_class *me, struct vfs_s_super *super,
|
||||
char *host, *user;
|
||||
int flags;
|
||||
|
||||
(void) me;
|
||||
(void) archive_name;
|
||||
(void) cookie;
|
||||
|
||||
op = vfs_split_url (strchr (op, ':') + 1, &host, &user, &flags, 0, 0,
|
||||
URL_NOSLASH);
|
||||
|
||||
@ -667,6 +673,7 @@ fish_linear_close (struct vfs_class *me, struct vfs_s_fh *fh)
|
||||
static int
|
||||
fish_ctl (void *fh, int ctlop, void *arg)
|
||||
{
|
||||
(void) arg;
|
||||
return 0;
|
||||
switch (ctlop) {
|
||||
case VFS_CTL_IS_NOTREADY:
|
||||
@ -848,6 +855,8 @@ static int
|
||||
fish_fh_open (struct vfs_class *me, struct vfs_s_fh *fh, int flags,
|
||||
int mode)
|
||||
{
|
||||
(void) mode;
|
||||
|
||||
fh->u.fish.append = 0;
|
||||
/* File will be written only, so no need to retrieve it */
|
||||
if (((flags & O_WRONLY) == O_WRONLY) && !(flags & (O_RDONLY | O_RDWR))) {
|
||||
|
28
vfs/ftpfs.c
28
vfs/ftpfs.c
@ -627,6 +627,8 @@ ftpfs_open_socket (struct vfs_class *me, struct vfs_s_super *super)
|
||||
char *host;
|
||||
int port = SUP.port;
|
||||
int free_host = 0;
|
||||
|
||||
(void) me;
|
||||
|
||||
/* Use a proxy host? */
|
||||
host = SUP.host;
|
||||
@ -751,6 +753,8 @@ ftpfs_open_archive (struct vfs_class *me, struct vfs_s_super *super,
|
||||
char *host, *user, *password;
|
||||
int port;
|
||||
|
||||
(void) archive_name;
|
||||
|
||||
ftpfs_split_url (strchr (op, ':') + 1, &host, &user, &port, &password);
|
||||
|
||||
SUP.host = host;
|
||||
@ -780,6 +784,10 @@ ftpfs_archive_same (struct vfs_class *me, struct vfs_s_super *super,
|
||||
char *host, *user;
|
||||
int port;
|
||||
|
||||
(void) me;
|
||||
(void) archive_name;
|
||||
(void) cookie;
|
||||
|
||||
ftpfs_split_url (strchr (op, ':') + 1, &host, &user, &port, 0);
|
||||
|
||||
port = ((strcmp (host, SUP.host) == 0)
|
||||
@ -1427,6 +1435,8 @@ ftpfs_linear_close (struct vfs_class *me, struct vfs_s_fh *fh)
|
||||
|
||||
static int ftpfs_ctl (void *fh, int ctlop, void *arg)
|
||||
{
|
||||
(void) arg;
|
||||
|
||||
switch (ctlop) {
|
||||
case VFS_CTL_IS_NOTREADY:
|
||||
{
|
||||
@ -1511,6 +1521,10 @@ static int ftpfs_chown (struct vfs_class *me, const char *path, int owner, int g
|
||||
#else
|
||||
/* Everyone knows it is not possible to chown remotely, so why bother them.
|
||||
If someone's root, then copy/move will always try to chown it... */
|
||||
(void) me;
|
||||
(void) path;
|
||||
(void) owner;
|
||||
(void) group;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@ -1524,6 +1538,8 @@ static int ftpfs_unlink (struct vfs_class *me, const char *path)
|
||||
static int
|
||||
ftpfs_is_same_dir (struct vfs_class *me, struct vfs_s_super *super, const char *path)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
if (!SUP.cwdir)
|
||||
return 0;
|
||||
if (strcmp (path, SUP.cwdir) == 0)
|
||||
@ -1562,6 +1578,8 @@ static int ftpfs_rename (struct vfs_class *me, const char *path1, const char *pa
|
||||
|
||||
static int ftpfs_mkdir (struct vfs_class *me, const char *path, mode_t mode)
|
||||
{
|
||||
(void) mode; /* FIXME: should be used */
|
||||
|
||||
return ftpfs_send_command(me, path, "MKD /%s", OPT_FLUSH);
|
||||
}
|
||||
|
||||
@ -1574,6 +1592,8 @@ static int
|
||||
ftpfs_fh_open (struct vfs_class *me, struct vfs_s_fh *fh, int flags,
|
||||
int mode)
|
||||
{
|
||||
(void) mode;
|
||||
|
||||
fh->u.ftp.append = 0;
|
||||
/* File will be written only, so no need to retrieve it from ftp server */
|
||||
if (((flags & O_WRONLY) == O_WRONLY) && !(flags & (O_RDONLY | O_RDWR))) {
|
||||
@ -1653,6 +1673,8 @@ ftpfs_done (struct vfs_class *me)
|
||||
{
|
||||
struct no_proxy_entry *np;
|
||||
|
||||
(void) me;
|
||||
|
||||
while (no_proxy) {
|
||||
np = no_proxy->next;
|
||||
g_free (no_proxy->domain);
|
||||
@ -1741,7 +1763,7 @@ static keyword_t ftpfs_netrc_next (void)
|
||||
return NETRC_UNKNOWN;
|
||||
}
|
||||
|
||||
static int ftpfs_netrc_bad_mode (const char *netrcname, const char *arg_netrc)
|
||||
static int ftpfs_netrc_bad_mode (const char *netrcname)
|
||||
{
|
||||
static int be_angry = 1;
|
||||
struct stat mystat;
|
||||
@ -1894,7 +1916,7 @@ static int ftpfs_netrc_lookup (const char *host, char **login, char **pass)
|
||||
|
||||
/* Ignore unsafe passwords */
|
||||
if (strcmp (*login, "anonymous") && strcmp (*login, "ftp")
|
||||
&& ftpfs_netrc_bad_mode (netrcname, netrc)) {
|
||||
&& ftpfs_netrc_bad_mode (netrcname)) {
|
||||
need_break = 1;
|
||||
break;
|
||||
}
|
||||
@ -1912,7 +1934,7 @@ static int ftpfs_netrc_lookup (const char *host, char **login, char **pass)
|
||||
}
|
||||
|
||||
/* Ignore account, but warn user anyways */
|
||||
ftpfs_netrc_bad_mode (netrcname, netrc);
|
||||
ftpfs_netrc_bad_mode (netrcname);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
51
vfs/local.c
51
vfs/local.c
@ -27,6 +27,8 @@ local_open (struct vfs_class *me, const char *file, int flags, int mode)
|
||||
int *local_info;
|
||||
int fd;
|
||||
|
||||
(void) me;
|
||||
|
||||
fd = open (file, NO_LINEAR (flags), mode);
|
||||
if (fd == -1)
|
||||
return 0;
|
||||
@ -73,6 +75,7 @@ local_close (void *data)
|
||||
int
|
||||
local_errno (struct vfs_class *me)
|
||||
{
|
||||
(void) me;
|
||||
return errno;
|
||||
}
|
||||
|
||||
@ -82,6 +85,8 @@ local_opendir (struct vfs_class *me, const char *dirname)
|
||||
DIR **local_info;
|
||||
DIR *dir;
|
||||
|
||||
(void) me;
|
||||
|
||||
dir = opendir (dirname);
|
||||
if (!dir)
|
||||
return 0;
|
||||
@ -111,12 +116,16 @@ local_closedir (void *data)
|
||||
static int
|
||||
local_stat (struct vfs_class *me, const char *path, struct stat *buf)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return stat (path, buf);
|
||||
}
|
||||
|
||||
static int
|
||||
local_lstat (struct vfs_class *me, const char *path, struct stat *buf)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
#ifndef HAVE_STATLSTAT
|
||||
return lstat (path,buf);
|
||||
#else
|
||||
@ -127,42 +136,55 @@ local_lstat (struct vfs_class *me, const char *path, struct stat *buf)
|
||||
int
|
||||
local_fstat (void *data, struct stat *buf)
|
||||
{
|
||||
return fstat (*((int *) data), buf);
|
||||
/* FIXME: avoid type cast */
|
||||
return fstat (*((int *) data), buf);
|
||||
}
|
||||
|
||||
static int
|
||||
local_chmod (struct vfs_class *me, const char *path, int mode)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return chmod (path, mode);
|
||||
}
|
||||
|
||||
static int
|
||||
local_chown (struct vfs_class *me, const char *path, int owner, int group)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return chown (path, owner, group);
|
||||
}
|
||||
|
||||
static int
|
||||
local_utime (struct vfs_class *me, const char *path, struct utimbuf *times)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return utime (path, times);
|
||||
}
|
||||
|
||||
static int
|
||||
local_readlink (struct vfs_class *me, const char *path, char *buf, size_t size)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return readlink (path, buf, size);
|
||||
}
|
||||
|
||||
static int
|
||||
local_unlink (struct vfs_class *me, const char *path)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return unlink (path);
|
||||
}
|
||||
|
||||
static int
|
||||
local_symlink (struct vfs_class *me, const char *n1, const char *n2)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return symlink (n1, n2);
|
||||
}
|
||||
|
||||
@ -191,12 +213,16 @@ local_write (void *data, const char *buf, int nbyte)
|
||||
static int
|
||||
local_rename (struct vfs_class *me, const char *a, const char *b)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return rename (a, b);
|
||||
}
|
||||
|
||||
static int
|
||||
local_chdir (struct vfs_class *me, const char *path)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return chdir (path);
|
||||
}
|
||||
|
||||
@ -211,30 +237,40 @@ local_lseek (void *data, off_t offset, int whence)
|
||||
static int
|
||||
local_mknod (struct vfs_class *me, const char *path, int mode, int dev)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mknod (path, mode, dev);
|
||||
}
|
||||
|
||||
static int
|
||||
local_link (struct vfs_class *me, const char *p1, const char *p2)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return link (p1, p2);
|
||||
}
|
||||
|
||||
static int
|
||||
local_mkdir (struct vfs_class *me, const char *path, mode_t mode)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mkdir (path, mode);
|
||||
}
|
||||
|
||||
static int
|
||||
local_rmdir (struct vfs_class *me, const char *path)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return rmdir (path);
|
||||
}
|
||||
|
||||
static char *
|
||||
local_getlocalcopy (struct vfs_class *me, const char *path)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return g_strdup (path);
|
||||
}
|
||||
|
||||
@ -242,6 +278,11 @@ static int
|
||||
local_ungetlocalcopy (struct vfs_class *me, const char *path,
|
||||
const char *local, int has_changed)
|
||||
{
|
||||
(void) me;
|
||||
(void) path;
|
||||
(void) local;
|
||||
(void) has_changed;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -251,12 +292,17 @@ local_mmap (struct vfs_class *me, caddr_t addr, size_t len, int prot, int flags,
|
||||
{
|
||||
int fd = * (int *)data;
|
||||
|
||||
(void) me;
|
||||
|
||||
return mmap (addr, len, prot, flags, fd, offset);
|
||||
}
|
||||
|
||||
int
|
||||
local_munmap (struct vfs_class *me, caddr_t addr, size_t len, void *data)
|
||||
{
|
||||
(void) me;
|
||||
(void) data;
|
||||
|
||||
return munmap (addr, len);
|
||||
}
|
||||
#endif
|
||||
@ -264,6 +310,9 @@ local_munmap (struct vfs_class *me, caddr_t addr, size_t len, void *data)
|
||||
static int
|
||||
local_which (struct vfs_class *me, const char *path)
|
||||
{
|
||||
(void) me;
|
||||
(void) path;
|
||||
|
||||
return 0; /* Every path which other systems do not like is expected to be ours */
|
||||
}
|
||||
|
||||
|
41
vfs/mcfs.c
41
vfs/mcfs.c
@ -103,6 +103,8 @@ mcfs_fill_names (struct vfs_class *me, fill_names_f func)
|
||||
int i;
|
||||
char *name;
|
||||
|
||||
(void) me;
|
||||
|
||||
for (i = 0; i < MCFS_MAX_CONNECTIONS; i++) {
|
||||
if (mcfs_connections[i].host == 0)
|
||||
continue;
|
||||
@ -525,6 +527,8 @@ mcfs_open (struct vfs_class *me, const char *file, int flags, int mode)
|
||||
int result, error_num;
|
||||
mcfs_handle *remote_handle;
|
||||
|
||||
(void) me;
|
||||
|
||||
if (!(remote_file = mcfs_get_path (&mc, file)))
|
||||
return 0;
|
||||
|
||||
@ -619,6 +623,8 @@ mcfs_close (void *data)
|
||||
static int
|
||||
mcfs_errno (struct vfs_class *me)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return my_errno;
|
||||
}
|
||||
|
||||
@ -645,6 +651,8 @@ mcfs_opendir (struct vfs_class *me, const char *dirname)
|
||||
char *remote_dir;
|
||||
int result;
|
||||
|
||||
(void) me;
|
||||
|
||||
if (!(remote_dir = mcfs_get_path (&mc, dirname)))
|
||||
return 0;
|
||||
|
||||
@ -884,6 +892,8 @@ mcfs_stat_cmd (int cmd, const char *path, struct stat *buf)
|
||||
static int
|
||||
mcfs_stat (struct vfs_class *me, const char *path, struct stat *buf)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_stat_cmd (MC_STAT, path, buf);
|
||||
}
|
||||
|
||||
@ -893,6 +903,8 @@ mcfs_lstat (struct vfs_class *me, const char *path, struct stat *buf)
|
||||
int path_len = strlen (path);
|
||||
int entry_len = strlen (mcfs_readdir_data.dent.d_name);
|
||||
|
||||
(void) me;
|
||||
|
||||
/* Hack ... */
|
||||
if (strcmp (path + path_len - entry_len,
|
||||
mcfs_readdir_data.dent.d_name) == 0 && cached_lstat_info) {
|
||||
@ -928,12 +940,16 @@ mcfs_fstat (void *data, struct stat *buf)
|
||||
static int
|
||||
mcfs_chmod (struct vfs_class *me, const char *path, int mode)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_path_int (MC_CHMOD, path, mode);
|
||||
}
|
||||
|
||||
static int
|
||||
mcfs_chown (struct vfs_class *me, const char *path, int owner, int group)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_path_int_int (MC_CHOWN, path, owner, group);
|
||||
}
|
||||
|
||||
@ -944,6 +960,8 @@ mcfs_utime (struct vfs_class *me, const char *path, struct utimbuf *times)
|
||||
int status;
|
||||
char *file;
|
||||
|
||||
(void) me;
|
||||
|
||||
if (!(file = mcfs_get_path (&mc, path)))
|
||||
return -1;
|
||||
|
||||
@ -977,6 +995,8 @@ mcfs_readlink (struct vfs_class *me, const char *path, char *buf, size_t size)
|
||||
mcfs_connection *mc;
|
||||
size_t len;
|
||||
|
||||
(void) me;
|
||||
|
||||
if (!(remote_file = mcfs_get_path (&mc, path)))
|
||||
return -1;
|
||||
|
||||
@ -1004,18 +1024,24 @@ mcfs_readlink (struct vfs_class *me, const char *path, char *buf, size_t size)
|
||||
static int
|
||||
mcfs_unlink (struct vfs_class *me, const char *path)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_path (MC_UNLINK, path);
|
||||
}
|
||||
|
||||
static int
|
||||
mcfs_symlink (struct vfs_class *me, const char *n1, const char *n2)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_two_paths (MC_SYMLINK, n1, n2);
|
||||
}
|
||||
|
||||
static int
|
||||
mcfs_rename (struct vfs_class *me, const char *a, const char *b)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_two_paths (MC_RENAME, a, b);
|
||||
}
|
||||
|
||||
@ -1026,6 +1052,8 @@ mcfs_chdir (struct vfs_class *me, const char *path)
|
||||
mcfs_connection *mc;
|
||||
int status, error;
|
||||
|
||||
(void) me;
|
||||
|
||||
if (!(remote_dir = mcfs_get_path (&mc, path)))
|
||||
return -1;
|
||||
|
||||
@ -1059,28 +1087,36 @@ mcfs_lseek (void *data, off_t offset, int whence)
|
||||
static int
|
||||
mcfs_mknod (struct vfs_class *me, const char *path, int mode, int dev)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_path_int_int (MC_MKNOD, path, mode, dev);
|
||||
}
|
||||
|
||||
static int
|
||||
mcfs_mkdir (struct vfs_class *me, const char *path, mode_t mode)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_path_int (MC_MKDIR, path, mode);
|
||||
}
|
||||
|
||||
static int
|
||||
mcfs_rmdir (struct vfs_class *me, const char *path)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_path (MC_RMDIR, path);
|
||||
}
|
||||
|
||||
static int
|
||||
mcfs_link (struct vfs_class *me, const char *p1, const char *p2)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
return mcfs_rpc_two_paths (MC_LINK, p1, p2);
|
||||
}
|
||||
|
||||
/* Gives up on a socket and reopnes the connection, the child own the socket
|
||||
/* Gives up on a socket and reopens the connection, the child own the socket
|
||||
* now
|
||||
*/
|
||||
static void
|
||||
@ -1128,6 +1164,9 @@ mcfs_forget (const char *path)
|
||||
static int
|
||||
mcfs_setctl (struct vfs_class *me, const char *path, int ctlop, void *arg)
|
||||
{
|
||||
(void) me;
|
||||
(void) arg;
|
||||
|
||||
switch (ctlop) {
|
||||
case VFS_SETCTL_FORGET:
|
||||
mcfs_forget (path);
|
||||
|
@ -1240,6 +1240,8 @@ get_client (int portnum)
|
||||
static void
|
||||
signal_int_handler (int sig)
|
||||
{
|
||||
(void) sig;
|
||||
|
||||
pmap_unset (RPC_PROGNUM, RPC_PROGVER);
|
||||
}
|
||||
#endif
|
||||
|
17
vfs/sfs.c
17
vfs/sfs.c
@ -51,6 +51,8 @@ static int sfs_flags[ MAXFS ];
|
||||
static int
|
||||
sfs_uptodate (char *name, char *cache)
|
||||
{
|
||||
(void) name;
|
||||
(void) cache;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -250,6 +252,8 @@ sfs_getid (struct vfs_class *me, const char *path)
|
||||
{
|
||||
struct cachedfile *cur = head;
|
||||
|
||||
(void) me;
|
||||
|
||||
while (cur) {
|
||||
if (!strcmp (path, cur->name))
|
||||
break;
|
||||
@ -284,6 +288,8 @@ static void sfs_fill_names (struct vfs_class *me, fill_names_f func)
|
||||
{
|
||||
struct cachedfile *cur = head;
|
||||
|
||||
(void) me;
|
||||
|
||||
while (cur){
|
||||
(*func)(cur->name);
|
||||
cur = cur->next;
|
||||
@ -294,6 +300,7 @@ static int sfs_nothingisopen (vfsid id)
|
||||
{
|
||||
/* FIXME: Investigate whether have to guard this like in
|
||||
the other VFSs (see fd_usage in extfs) -- Norbert */
|
||||
(void) id;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -308,6 +315,10 @@ static int
|
||||
sfs_ungetlocalcopy (struct vfs_class *me, const char *path,
|
||||
const char *local, int has_changed)
|
||||
{
|
||||
(void) me;
|
||||
(void) path;
|
||||
(void) local;
|
||||
(void) has_changed;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -317,6 +328,8 @@ static int sfs_init (struct vfs_class *me)
|
||||
FILE *cfg;
|
||||
char key[256];
|
||||
|
||||
(void) me;
|
||||
|
||||
mc_sfsini = concat_dir_and_file (mc_home, "extfs" PATH_SEP_STR "sfs.ini");
|
||||
cfg = fopen (mc_sfsini, "r");
|
||||
|
||||
@ -384,6 +397,8 @@ sfs_done (struct vfs_class *me)
|
||||
{
|
||||
int i;
|
||||
|
||||
(void) me;
|
||||
|
||||
for (i = 0; i < sfs_no; i++){
|
||||
g_free (sfs_prefix [i]);
|
||||
g_free (sfs_command [i]);
|
||||
@ -397,6 +412,8 @@ sfs_which (struct vfs_class *me, const char *path)
|
||||
{
|
||||
int i;
|
||||
|
||||
(void) me;
|
||||
|
||||
for (i = 0; i < sfs_no; i++)
|
||||
if (sfs_flags [i] & F_FULLMATCH) {
|
||||
if (!strcmp (path, sfs_prefix [i]))
|
||||
|
64
vfs/smbfs.c
64
vfs/smbfs.c
@ -338,6 +338,9 @@ smbfs_fill_names (struct vfs_class *me, fill_names_f func)
|
||||
{
|
||||
int i;
|
||||
char *path;
|
||||
|
||||
(void) me;
|
||||
|
||||
for (i = 0; i < SMBFS_MAX_CONNECTIONS; i++) {
|
||||
if (smbfs_connections [i].cli) {
|
||||
path = g_strconcat (URL_HEADER,
|
||||
@ -408,7 +411,9 @@ smbfs_close (void *data)
|
||||
static int
|
||||
smbfs_errno (struct vfs_class *me)
|
||||
{
|
||||
DEBUG(3, ("smbfs_errno: %s\n", g_strerror(my_errno)));
|
||||
(void) me;
|
||||
|
||||
DEBUG(3, ("smbfs_errno: %s\n", g_strerror(my_errno)));
|
||||
return my_errno;
|
||||
}
|
||||
|
||||
@ -461,9 +466,10 @@ static void
|
||||
smbfs_browsing_helper (const char *name, uint32 type, const char *comment, void *state)
|
||||
{
|
||||
const char *typestr = "";
|
||||
|
||||
dir_entry *new_entry = smbfs_new_dir_entry (name);
|
||||
|
||||
(void) state;
|
||||
|
||||
switch (type) {
|
||||
case STYPE_DISKTREE:
|
||||
typestr = "Disk";
|
||||
@ -490,6 +496,9 @@ smbfs_loaddir_helper (file_info * finfo, const char *mask, void *entry)
|
||||
{
|
||||
dir_entry *new_entry = (dir_entry *) entry;
|
||||
time_t t = finfo->mtime; /* the time is assumed to be passed as GMT */
|
||||
|
||||
(void) mask;
|
||||
|
||||
#if 0 /* I want to see dot files */
|
||||
if (finfo->mode & aHIDDEN)
|
||||
return; /* don't bother with hidden files, "~$" screws up mc */
|
||||
@ -562,6 +571,9 @@ smbfs_srv_browsing_helper (const char *name, uint32 m, const char *comment,
|
||||
{
|
||||
dir_entry *new_entry = smbfs_new_dir_entry (name);
|
||||
|
||||
(void) m;
|
||||
(void) state;
|
||||
|
||||
/* show this as dir */
|
||||
new_entry->my_stat.st_mode =
|
||||
(S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH | S_IXUSR | S_IXGRP |
|
||||
@ -839,6 +851,8 @@ smbfs_closedir (void *info)
|
||||
static int
|
||||
smbfs_chmod (struct vfs_class *me, const char *path, int mode)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
DEBUG(3, ("smbfs_chmod(path:%s, mode:%d)\n", path, mode));
|
||||
/* my_errno = EOPNOTSUPP;
|
||||
return -1; */ /* cannot chmod on smb filesystem */
|
||||
@ -848,6 +862,8 @@ smbfs_chmod (struct vfs_class *me, const char *path, int mode)
|
||||
static int
|
||||
smbfs_chown (struct vfs_class *me, const char *path, int owner, int group)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
DEBUG(3, ("smbfs_chown(path:%s, owner:%d, group:%d)\n", path, owner, group));
|
||||
my_errno = EOPNOTSUPP; /* ready for your labotomy? */
|
||||
return -1;
|
||||
@ -856,27 +872,34 @@ smbfs_chown (struct vfs_class *me, const char *path, int owner, int group)
|
||||
static int
|
||||
smbfs_utime (struct vfs_class *me, const char *path, struct utimbuf *times)
|
||||
{
|
||||
(void) me;
|
||||
(void) times;
|
||||
|
||||
DEBUG(3, ("smbfs_utime(path:%s)\n", path));
|
||||
my_errno = EOPNOTSUPP;
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
smbfs_readlink (struct vfs_class *me, const char *path, char *buf, size_t size)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
DEBUG (3,
|
||||
("smbfs_readlink(path:%s, buf:%s, size:%d)\n", path, buf,
|
||||
(int) size));
|
||||
my_errno = EOPNOTSUPP;
|
||||
return -1; /* no symlinks on smb filesystem? */
|
||||
return -1; /* no symlinks on smb filesystem? */
|
||||
}
|
||||
|
||||
static int
|
||||
smbfs_symlink (struct vfs_class *me, const char *n1, const char *n2)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
DEBUG(3, ("smbfs_symlink(n1:%s, n2:%s)\n", n1, n2));
|
||||
my_errno = EOPNOTSUPP;
|
||||
return -1; /* no symlinks on smb filesystem? */
|
||||
return -1; /* no symlinks on smb filesystem? */
|
||||
}
|
||||
|
||||
/* Extract the hostname and username from the path */
|
||||
@ -1208,12 +1231,14 @@ smbfs_opendir (struct vfs_class *me, const char *dirname)
|
||||
smbfs_connection *sc;
|
||||
char *remote_dir;
|
||||
|
||||
DEBUG(3, ("smbfs_opendir(dirname:%s)\n", dirname));
|
||||
(void) me;
|
||||
|
||||
DEBUG(3, ("smbfs_opendir(dirname:%s)\n", dirname));
|
||||
|
||||
if (!(remote_dir = smbfs_get_path (&sc, dirname)))
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
/* FIXME: where freed? */
|
||||
/* FIXME: where freed? */
|
||||
smbfs_info = g_new (opendir_info, 1);
|
||||
smbfs_info->server_list = FALSE;
|
||||
smbfs_info->path = g_strdup(dirname); /* keep original */
|
||||
@ -1231,6 +1256,8 @@ smbfs_fake_server_stat (const char *server_url, const char *path, struct stat *b
|
||||
dir_entry *dentry;
|
||||
const char *p;
|
||||
|
||||
(void) server_url;
|
||||
|
||||
if ((p = strrchr (path, '/')))
|
||||
path = p + 1; /* advance until last '/' */
|
||||
|
||||
@ -1456,6 +1483,8 @@ smbfs_chdir (struct vfs_class *me, const char *path)
|
||||
char *remote_dir;
|
||||
smbfs_connection *sc;
|
||||
|
||||
(void) me;
|
||||
|
||||
DEBUG (3, ("smbfs_chdir(path:%s)\n", path));
|
||||
if (!(remote_dir = smbfs_get_path (&sc, path)))
|
||||
return -1;
|
||||
@ -1625,6 +1654,8 @@ smbfs_lseek (void *data, off_t offset, int whence)
|
||||
static int
|
||||
smbfs_mknod (struct vfs_class *me, const char *path, int mode, int dev)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
DEBUG(3, ("smbfs_mknod(path:%s, mode:%d, dev:%d)\n", path, mode, dev));
|
||||
my_errno = EOPNOTSUPP;
|
||||
return -1;
|
||||
@ -1637,6 +1668,8 @@ smbfs_mkdir (struct vfs_class * me, const char *path, mode_t mode)
|
||||
char *remote_file;
|
||||
char *cpath;
|
||||
|
||||
(void) me;
|
||||
|
||||
DEBUG (3, ("smbfs_mkdir(path:%s, mode:%d)\n", path, (int) mode));
|
||||
if ((remote_file = smbfs_get_path (&sc, path)) == 0)
|
||||
return -1;
|
||||
@ -1661,6 +1694,8 @@ smbfs_rmdir (struct vfs_class *me, const char *path)
|
||||
char *remote_file;
|
||||
char *cpath;
|
||||
|
||||
(void) me;
|
||||
|
||||
DEBUG(3, ("smbfs_rmdir(path:%s)\n", path));
|
||||
if ((remote_file = smbfs_get_path (&sc, path)) == 0)
|
||||
return -1;
|
||||
@ -1682,6 +1717,8 @@ smbfs_rmdir (struct vfs_class *me, const char *path)
|
||||
static int
|
||||
smbfs_link (struct vfs_class *me, const char *p1, const char *p2)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
DEBUG (3, ("smbfs_link(p1:%s, p2:%s)\n", p1, p2));
|
||||
my_errno = EOPNOTSUPP;
|
||||
return -1;
|
||||
@ -1736,6 +1773,9 @@ smbfs_forget (const char *path)
|
||||
static int
|
||||
smbfs_setctl (struct vfs_class *me, const char *path, int ctlop, void *arg)
|
||||
{
|
||||
(void) me;
|
||||
(void) arg;
|
||||
|
||||
DEBUG (3, ("smbfs_setctl(path:%s, ctlop:%d)\n", path, ctlop));
|
||||
switch (ctlop) {
|
||||
case VFS_SETCTL_FORGET:
|
||||
@ -1751,6 +1791,8 @@ smbfs_open_readwrite (smbfs_handle *remote_handle, char *rname, int flags, int m
|
||||
{
|
||||
size_t size;
|
||||
|
||||
(void) mode;
|
||||
|
||||
if (flags & O_TRUNC) /* if it exists truncate to zero */
|
||||
DEBUG (3, ("smbfs_open: O_TRUNC\n"));
|
||||
|
||||
@ -1807,6 +1849,8 @@ smbfs_open (struct vfs_class *me, const char *file, int flags, int mode)
|
||||
smbfs_connection *sc;
|
||||
smbfs_handle *remote_handle;
|
||||
|
||||
(void) me;
|
||||
|
||||
DEBUG(3, ("smbfs_open(file:%s, flags:%d, mode:%o)\n", file, flags, mode));
|
||||
|
||||
if (!(remote_file = smbfs_get_path (&sc, file)))
|
||||
@ -1833,6 +1877,8 @@ smbfs_unlink (struct vfs_class *me, const char *path)
|
||||
smbfs_connection *sc;
|
||||
char *remote_file;
|
||||
|
||||
(void) me;
|
||||
|
||||
if ((remote_file = smbfs_get_path (&sc, path)) == 0)
|
||||
return -1;
|
||||
|
||||
@ -1855,6 +1901,8 @@ smbfs_rename (struct vfs_class *me, const char *a, const char *b)
|
||||
char *ra, *rb;
|
||||
int retval;
|
||||
|
||||
(void) me;
|
||||
|
||||
if ((ra = smbfs_get_path (&sc, a)) == 0)
|
||||
return -1;
|
||||
|
||||
|
20
vfs/tar.c
20
vfs/tar.c
@ -193,6 +193,8 @@ static long tar_from_oct (int digs, char *where)
|
||||
|
||||
static void tar_free_archive (struct vfs_class *me, struct vfs_s_super *archive)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
if (archive->u.arch.fd != -1)
|
||||
mc_close(archive->u.arch.fd);
|
||||
}
|
||||
@ -262,6 +264,8 @@ tar_get_next_record (struct vfs_s_super *archive, int tard)
|
||||
{
|
||||
int n;
|
||||
|
||||
(void) archive;
|
||||
|
||||
n = mc_read (tard, rec_buf.charptr, RECORDSIZE);
|
||||
if (n != RECORDSIZE)
|
||||
return NULL; /* An error has occurred */
|
||||
@ -271,6 +275,8 @@ tar_get_next_record (struct vfs_s_super *archive, int tard)
|
||||
|
||||
static void tar_skip_n_records (struct vfs_s_super *archive, int tard, int n)
|
||||
{
|
||||
(void) archive;
|
||||
|
||||
mc_lseek (tard, n * RECORDSIZE, SEEK_CUR);
|
||||
current_tar_position += n * RECORDSIZE;
|
||||
}
|
||||
@ -279,6 +285,8 @@ static void
|
||||
tar_fill_stat (struct vfs_class *me, struct stat *st, union record *header,
|
||||
size_t h_size)
|
||||
{
|
||||
(void) me;
|
||||
|
||||
st->st_mode = tar_from_oct (8, header->header.mode);
|
||||
|
||||
/* Adjust st->st_mode because there are tar-files with
|
||||
@ -550,6 +558,8 @@ tar_open_archive (struct vfs_class *me, struct vfs_s_super *archive,
|
||||
ReadStatus prev_status;
|
||||
int tard;
|
||||
|
||||
(void) op;
|
||||
|
||||
current_tar_position = 0;
|
||||
/* Open for reading */
|
||||
if ((tard = tar_open_archive_int (me, name, archive)) == -1)
|
||||
@ -614,6 +624,10 @@ static void *
|
||||
tar_super_check (struct vfs_class *me, const char *archive_name, char *op)
|
||||
{
|
||||
static struct stat stat_buf;
|
||||
|
||||
(void) me;
|
||||
(void) op;
|
||||
|
||||
if (mc_stat (archive_name, &stat_buf))
|
||||
return NULL;
|
||||
return &stat_buf;
|
||||
@ -625,6 +639,9 @@ tar_super_same (struct vfs_class *me, struct vfs_s_super *parc,
|
||||
{
|
||||
struct stat *archive_stat = cookie; /* stat of main archive */
|
||||
|
||||
(void) me;
|
||||
(void) op;
|
||||
|
||||
if (strcmp (parc->name, archive_name))
|
||||
return 0;
|
||||
|
||||
@ -659,6 +676,9 @@ static int tar_read (void *fh, char *buffer, int count)
|
||||
|
||||
static int tar_fh_open (struct vfs_class *me, struct vfs_s_fh *fh, int flags, int mode)
|
||||
{
|
||||
(void) fh;
|
||||
(void) mode;
|
||||
|
||||
if ((flags & O_ACCMODE) != O_RDONLY) ERRNOR (EROFS, -1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ int got_sigpipe;
|
||||
static void
|
||||
sig_pipe (int unused)
|
||||
{
|
||||
(void) unused;
|
||||
got_sigpipe = 1;
|
||||
}
|
||||
|
||||
|
@ -798,7 +798,7 @@ mc_munmap (caddr_t addr, size_t len)
|
||||
#endif
|
||||
|
||||
static char *
|
||||
mc_def_getlocalcopy (struct vfs_class *vfs, const char *filename)
|
||||
mc_def_getlocalcopy (const char *filename)
|
||||
{
|
||||
char *tmp;
|
||||
int fdin, fdout, i;
|
||||
@ -850,7 +850,7 @@ mc_getlocalcopy (const char *pathname)
|
||||
struct vfs_class *vfs = vfs_get_class (path);
|
||||
|
||||
result = vfs->getlocalcopy ? (*vfs->getlocalcopy)(vfs, path) :
|
||||
mc_def_getlocalcopy (vfs, path);
|
||||
mc_def_getlocalcopy (path);
|
||||
g_free (path);
|
||||
if (!result)
|
||||
errno = ferrno (vfs);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user