diff --git a/ChangeLog b/ChangeLog index 9ee46dc7..88ec652e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/libntfs/volume.c b/libntfs/volume.c index 7f8e0a39..db786ef2 100644 --- a/libntfs/volume.c +++ b/libntfs/volume.c @@ -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; } /** diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index d3cdebad..a9dc6a4c 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -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; }