1
1

* 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.
Этот коммит содержится в:
Andrew V. Samoilov 2004-12-29 07:32:41 +00:00
родитель be3728903b
Коммит 1735921c14
2 изменённых файлов: 17 добавлений и 14 удалений

Просмотреть файл

@ -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> 2004-12-28 Dmitry Butskoj <buc@odusz.so-cdu.ru>
* fish.c (fish_linear_abort): Fix bug with FISH vfs. It freezes MC on * fish.c (fish_linear_abort): Fix bug with FISH vfs. It freezes MC on

Просмотреть файл

@ -56,7 +56,6 @@ struct inode {
gid_t gid; gid_t gid;
off_t size; off_t size;
time_t mtime; time_t mtime;
char linkflag;
char *linkname; char *linkname;
time_t atime; time_t atime;
time_t ctime; 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 (current_link_name);
} }
} }
g_free (buffer);
/* Check if extfs 'list' returned 0 */ /* Check if extfs 'list' returned 0 */
if (pclose (extfsd) != 0) { if (pclose (extfsd) != 0) {
g_free (buffer);
extfs_free (current_archive); extfs_free (current_archive);
close_error_pipe (1, _("Inconsistent extfs archive")); close_error_pipe (1, _("Inconsistent extfs archive"));
return -1; return -1;
@ -421,7 +420,6 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc)
close_error_pipe (1, NULL); close_error_pipe (1, NULL);
*pparc = current_archive; *pparc = current_archive;
g_free (buffer);
return 0; return 0;
} }
@ -902,7 +900,7 @@ static int extfs_closedir (void *data)
return 0; 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_dev = inode->dev;
buf->st_ino = inode->inode; 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; 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; struct archive *archive;
char *q; char *q;
struct entry *entry; struct entry *entry;
struct inode *inode;
char *path2 = g_strdup (path); char *path2 = g_strdup (path);
int result = -1; int result = -1;
@ -941,8 +940,7 @@ static int extfs_internal_stat (struct vfs_class *me, const char *path, struct s
goto cleanup; goto cleanup;
if (resolve && (entry = extfs_resolve_symlinks (entry)) == NULL) if (resolve && (entry = extfs_resolve_symlinks (entry)) == NULL)
goto cleanup; goto cleanup;
inode = entry->inode; extfs_stat_move (buf, entry->inode);
extfs_stat_move( buf, inode );
result = 0; result = 0;
cleanup: cleanup:
g_free (path2); 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) static int extfs_fstat (void *data, struct stat *buf)
{ {
struct pseudofile *file = (struct pseudofile *)data; struct pseudofile *file = (struct pseudofile *)data;
struct inode *inode;
inode = file->entry->inode; extfs_stat_move (buf, file->entry->inode);
extfs_stat_move( buf, inode );
return 0; return 0;
} }
@ -1019,7 +1015,7 @@ static int extfs_unlink (struct vfs_class *me, const char *file)
int result = -1; 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, 0)) == NULL)
return -1; goto cleanup;
entry = extfs_find_entry (archive->root_entry, q, 0, 0); entry = extfs_find_entry (archive->root_entry, q, 0, 0);
if (entry == NULL) if (entry == NULL)
goto cleanup; goto cleanup;