Change errno and print more verbose message in case if logfile check failed.
parent
f0ff698c22
commit
4088de1017
|
@ -16,6 +16,8 @@ xx/xx/xxxx - 1.12.0-WIP
|
|||
- ntfscp: fix attribute name parsing bug introduced in 1.10.0. (Yura)
|
||||
- ntfsinfo: dump more information for indexes. (Yura)
|
||||
- Fix unistr.c::ntfs_mbstoucs on systems with utf8 locale. (Yura)
|
||||
- Change errno and print more verbose message in case if logfile check
|
||||
failed. (Yura)
|
||||
|
||||
20/07/2005 - 1.11.1 - Fix several ntfsmount bugs.
|
||||
|
||||
|
|
|
@ -562,7 +562,7 @@ static int ntfs_volume_check_logfile(ntfs_volume *vol)
|
|||
{
|
||||
ntfs_inode *ni;
|
||||
ntfs_attr *na = NULL;
|
||||
int ret, err = 0;
|
||||
int err = 0;
|
||||
|
||||
if ((ni = ntfs_inode_open(vol, FILE_LogFile)) == NULL) {
|
||||
Dprintf("Failed to open inode FILE_LogFile.\n");
|
||||
|
@ -571,23 +571,20 @@ static int ntfs_volume_check_logfile(ntfs_volume *vol)
|
|||
}
|
||||
if ((na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0)) == NULL) {
|
||||
Dprintf("Failed to open $FILE_LogFile/$DATA\n");
|
||||
ret = -1;
|
||||
err = EIO;
|
||||
goto exit;
|
||||
}
|
||||
if (ntfs_check_logfile(na) && ntfs_is_logfile_clean(na))
|
||||
ret = 0;
|
||||
else {
|
||||
ret = -1;
|
||||
err = EIO;
|
||||
}
|
||||
if (!ntfs_check_logfile(na) || !ntfs_is_logfile_clean(na))
|
||||
err = EOPNOTSUPP;
|
||||
exit:
|
||||
if (na)
|
||||
ntfs_attr_close(na);
|
||||
ntfs_inode_close(ni);
|
||||
if (ret)
|
||||
if (err) {
|
||||
errno = err;
|
||||
return ret;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -154,7 +154,14 @@ ntfs_volume * utils_mount_volume (const char *device, unsigned long flags, BOOL
|
|||
|
||||
vol = ntfs_mount (device, flags);
|
||||
if (!vol) {
|
||||
Eprintf ("Couldn't mount device '%s': %s\n", device, strerror (errno));
|
||||
int err;
|
||||
|
||||
err = errno;
|
||||
Eprintf("Couldn't mount device '%s': %s\n", device,
|
||||
strerror(err));
|
||||
if (err == EOPNOTSUPP)
|
||||
Eprintf("It's seems that logfile check failed. "
|
||||
"Try to mount volume in windows.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue