From 57cc7904c9ea4f16ca3a352f7e13c194bfe2dca4 Mon Sep 17 00:00:00 2001 From: Yura Pakhuchiy Date: Sat, 15 Sep 2007 17:31:39 +0300 Subject: [PATCH] cleanups (Szaka) --- libntfs/index.c | 4 +++- ntfsprogs/ntfsmount.c | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libntfs/index.c b/libntfs/index.c index 5e5760b3..843960a0 100644 --- a/libntfs/index.c +++ b/libntfs/index.c @@ -1490,7 +1490,7 @@ int ntfs_index_add_filename(ntfs_inode *ni, FILE_NAME_ATTR *fn, MFT_REF mref) { INDEX_ENTRY *ie; ntfs_index_context *icx; - int fn_size, ie_size, ret = -1; + int fn_size, ie_size, ret = -1, err; ntfs_log_trace("Entering.\n"); @@ -1517,7 +1517,9 @@ int ntfs_index_add_filename(ntfs_inode *ni, FILE_NAME_ATTR *fn, MFT_REF mref) if (!icx) goto out; + err = errno; ret = ntfs_ie_add(icx, ie); + errno = err; ntfs_index_ctx_put(icx); out: diff --git a/ntfsprogs/ntfsmount.c b/ntfsprogs/ntfsmount.c index 2078c09f..736e6ad2 100644 --- a/ntfsprogs/ntfsmount.c +++ b/ntfsprogs/ntfsmount.c @@ -594,8 +594,10 @@ static int ntfs_fuse_read(const char *org_path, char *buf, size_t size, while (size) { res = ntfs_attr_pread(na, offset, size, buf); if (res < (s64)size) - ntfs_log_error("ntfs_attr_pread returned less bytes " - "than requested.\n"); + ntfs_log_error("ntfs_attr_pread returned %d bytes " + "instead of requested %lld bytes " + "(offset %lld).\n", res, + (long long)size, (long long)offset); if (res <= 0) { res = -errno; goto exit; @@ -642,8 +644,10 @@ static int ntfs_fuse_write(const char *org_path, const char *buf, size_t size, while (size) { res = ntfs_attr_pwrite(na, offset, size, buf); if (res < (s64)size && errno != ENOSPC) - ntfs_log_error("ntfs_attr_pwrite returned less bytes " - "than requested.\n"); + ntfs_log_error("ntfs_attr_pwrite returned %d bytes " + "instead of requested %lld bytes " + "(offset %lld).\n", res, + (long long)size, (long long)offset); if (res <= 0) { res = -errno; goto exit;