* extfs.c (struct inode): Remove unused linkflag field.
(extfs_internal_stat): Eliminate "inode" variable. (extfs_fstat): Likewise. (extfs_unlink): Fix memory leak if extfs_get_path_mangle() fails.
Этот коммит содержится в:
родитель
be3728903b
Коммит
1735921c14
@ -1,3 +1,10 @@
|
||||
2004-12-29 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* extfs.c (struct inode): Remove unused linkflag field.
|
||||
(extfs_internal_stat): Eliminate "inode" variable.
|
||||
(extfs_fstat): Likewise.
|
||||
(extfs_unlink): Fix memory leak if extfs_get_path_mangle() fails.
|
||||
|
||||
2004-12-28 Dmitry Butskoj <buc@odusz.so-cdu.ru>
|
||||
|
||||
* fish.c (fish_linear_abort): Fix bug with FISH vfs. It freezes MC on
|
||||
|
20
vfs/extfs.c
20
vfs/extfs.c
@ -56,7 +56,6 @@ struct inode {
|
||||
gid_t gid;
|
||||
off_t size;
|
||||
time_t mtime;
|
||||
char linkflag;
|
||||
char *linkname;
|
||||
time_t atime;
|
||||
time_t ctime;
|
||||
@ -410,10 +409,10 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
|
||||
g_free (current_link_name);
|
||||
}
|
||||
}
|
||||
g_free (buffer);
|
||||
|
||||
/* Check if extfs 'list' returned 0 */
|
||||
if (pclose (extfsd) != 0) {
|
||||
g_free (buffer);
|
||||
extfs_free (current_archive);
|
||||
close_error_pipe (1, _("Inconsistent extfs archive"));
|
||||
return -1;
|
||||
@ -421,7 +420,6 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
|
||||
|
||||
close_error_pipe (1, NULL);
|
||||
*pparc = current_archive;
|
||||
g_free (buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -902,7 +900,7 @@ static int extfs_closedir (void *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void extfs_stat_move( struct stat *buf, struct inode *inode )
|
||||
static void extfs_stat_move (struct stat *buf, const struct inode *inode)
|
||||
{
|
||||
buf->st_dev = inode->dev;
|
||||
buf->st_ino = inode->inode;
|
||||
@ -925,12 +923,13 @@ static void extfs_stat_move( struct stat *buf, struct inode *inode )
|
||||
buf->st_ctime = inode->ctime;
|
||||
}
|
||||
|
||||
static int extfs_internal_stat (struct vfs_class *me, const char *path, struct stat *buf, int resolve)
|
||||
static int
|
||||
extfs_internal_stat (struct vfs_class *me, const char *path, struct stat *buf,
|
||||
int resolve)
|
||||
{
|
||||
struct archive *archive;
|
||||
char *q;
|
||||
struct entry *entry;
|
||||
struct inode *inode;
|
||||
char *path2 = g_strdup (path);
|
||||
int result = -1;
|
||||
|
||||
@ -941,8 +940,7 @@ static int extfs_internal_stat (struct vfs_class *me, const char *path, struct s
|
||||
goto cleanup;
|
||||
if (resolve && (entry = extfs_resolve_symlinks (entry)) == NULL)
|
||||
goto cleanup;
|
||||
inode = entry->inode;
|
||||
extfs_stat_move( buf, inode );
|
||||
extfs_stat_move (buf, entry->inode);
|
||||
result = 0;
|
||||
cleanup:
|
||||
g_free (path2);
|
||||
@ -962,10 +960,8 @@ static int extfs_lstat (struct vfs_class *me, const char *path, struct stat *buf
|
||||
static int extfs_fstat (void *data, struct stat *buf)
|
||||
{
|
||||
struct pseudofile *file = (struct pseudofile *)data;
|
||||
struct inode *inode;
|
||||
|
||||
inode = file->entry->inode;
|
||||
extfs_stat_move( buf, inode );
|
||||
extfs_stat_move (buf, file->entry->inode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1019,7 +1015,7 @@ static int extfs_unlink (struct vfs_class *me, const char *file)
|
||||
int result = -1;
|
||||
|
||||
if ((q = extfs_get_path_mangle (me, mpath, &archive, 0, 0)) == NULL)
|
||||
return -1;
|
||||
goto cleanup;
|
||||
entry = extfs_find_entry (archive->root_entry, q, 0, 0);
|
||||
if (entry == NULL)
|
||||
goto cleanup;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user