Checking the return value of Write() in CopyData mailnews/imap/src/nsImapMailFolder.cpp

RESOLVED DUPLICATE of bug 1242030

Status

RESOLVED DUPLICATE of bug 1242030
5 years ago
2 years ago

People

(Reporter: ishikawa, Assigned: ishikawa)

Tracking

Trunk
All
Windows 7

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 8333493 [details] [diff] [review]
(Work-in-progress) Check the return values of  Write() and maybe Close() in nsImapMailFolder.cpp.patch

(This is related to Bug 939548.
I am checking for some I/O issues not checked properly by TB when
the underlying file system is a remotely mounted CIFS-share.
I recognized the issue is very similar in nature to
Bug 936990)

The return value of Write() is not checked in a few places, and
also I noticed the return value of Close() is not checked in many places.
These are bad coding style since remotely mounted filesystem can fail in Write() and Close() during transient network errors (or for that matter, local
file system can return errors to write() or close() when the file system becomes full.)

So these should be checked.

I am attaching a patch that checks the return value of Write(), but
just marked places where the return value of Close() is not checked.

TIA
(Assignee)

Updated

5 years ago
Assignee: nobody → ishikawa
See Also: → bug 939548

Comment 1

5 years ago
Do we really NOT want a message in the console when these fail (very rare)? If we want, you can use NS_ENSURE_SUCCESS(rv, rv).
(Assignee)

Comment 2

5 years ago
(In reply to :aceman from comment #1)
> Do we really NOT want a message in the console when these fail (very rare)?
> If we want, you can use NS_ENSURE_SUCCESS(rv, rv).

Yes, I want it printed. I got quite confused with these macro's semantics.
Thank you for pointing this out.

I will roll up another patch.

TIA

Updated

5 years ago
Component: Untriaged → Networking: IMAP
Product: Thunderbird → MailNews Core
(Assignee)

Comment 3

2 years ago
This is now being taken care of in bug Bug 1242030 - Consolidated patch set from bug 1122698, bug 1134527, bug 1134529, bug 1174500
Especially the patch named
 fix-close-MERGED-imap-dir.patch 
there.

So I am setting this as duplicate of that bug.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1242030
You need to log in before you can comment on or make changes to this bug.