From a6c4be00b5500f7faf833872755f6861d3f13378 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Tue, 14 Apr 2009 12:24:59 +0200 Subject: [PATCH] Code cleanup: remove unused variable in src/ntfs_dir.c Make fd variable more local in src/ntfs_udl.c --- src/ntfs_dir.c | 4 ---- src/ntfs_udl.c | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ntfs_dir.c b/src/ntfs_dir.c index 0a139e5f..afd0144f 100644 --- a/src/ntfs_dir.c +++ b/src/ntfs_dir.c @@ -408,12 +408,8 @@ static int ntfs_copy(disk_t *disk_car, const partition_t *partition, dir_data_t static void dir_partition_ntfs_close(dir_data_t *dir_data) { - const partition_t *partition; - disk_t *disk_car; struct ntfs_dir_struct *ls=(struct ntfs_dir_struct*)dir_data->private_dir_data; /* ntfs_umount() will invoke ntfs_device_free() for us. */ - disk_car=ls->my_data->disk_car; - partition=ls->my_data->partition; ntfs_umount(ls->vol, FALSE); free(ls->my_data); #ifdef HAVE_ICONV diff --git a/src/ntfs_udl.c b/src/ntfs_udl.c index 2210791e..119173ca 100644 --- a/src/ntfs_udl.c +++ b/src/ntfs_udl.c @@ -838,7 +838,6 @@ static int undelete_file(ntfs_volume *vol, long long inode) long long start, end; runlist_element *rl; struct td_list_head *item; - int fd = -1; long long k; int result = -2; char *name; @@ -888,6 +887,7 @@ static int undelete_file(ntfs_volume *vol, long long inode) //dir_data->local_dir; create_pathname(opts.dest, file->pref_pname, name, d->name, pathname, sizeof(pathname)); if (d->resident) { + int fd; fd = open_file(pathname); if (fd < 0) { log_error("Couldn't create file %s\n", pathname); @@ -904,8 +904,8 @@ static int undelete_file(ntfs_volume *vol, long long inode) if (close(fd) < 0) { log_error("Close failed\n"); } - fd = -1; } else { + int fd; rl = d->runlist; if (!rl) { log_verbose("File has no runlist, hence no data.\n"); @@ -1030,7 +1030,6 @@ static int undelete_file(ntfs_volume *vol, long long inode) if (close(fd) < 0) { log_error("Close failed\n"); } - fd = -1; } set_date(pathname, file->date, file->date);