Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#5679 closed defect (fixed)

The return value of IsMounted() is not checked

Reported by: Erik Hovland <erik@…> Owned by: Nigel
Priority: trivial Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

The member function IsMounted() is not checked every time.

The one time it isn't, what the caller actually wants to do is initialize m_MountPath. So that means that IsMounted actually has a side effect and that effect is the only desired change that the caller wants. So I have gone with a fairly aggressive patch for this fix.

The patch creates a new member function called findMountPath() that does the work that IsMounted() does. Then I have IsMounted() call that when necessary and change the caller to use this new member function.

It also turns out that the default parameter argument of false for IsMounted is not a real reflection on how it is used. Only one call uses the default. So I changed it so the default is true and changed that call.

Attachments (3)

libs_libmyth-check-return.patch (15.2 KB ) - added by Erik Hovland <erik@…> 17 years ago.
reworks IsMounted and m_MountPath
isMounted.patch (10.3 KB ) - added by Nigel 17 years ago.
isMounted.2.patch (10.3 KB ) - added by Nigel 17 years ago.
Fix error in VERBOSE string

Download all attachments as: .zip

Change History (8)

by Erik Hovland <erik@…>, 17 years ago

reworks IsMounted and m_MountPath

comment:1 by Nigel, 17 years ago

Owner: changed from Isaac Richards to Nigel
Status: newassigned

Good patch, Erik. I have a slightly simpler version attached (moves findMountPath() directly after isMounted() to reduce diff size). Will test and apply this week. If anyone else also has time to test, I would appreciate it.

by Nigel, 17 years ago

Attachment: isMounted.patch added

by Nigel, 17 years ago

Attachment: isMounted.2.patch added

Fix error in VERBOSE string

comment:2 by Nigel, 17 years ago

(In [18266]) Patch by Erik Hovland to rework isMounted(). See #5679

comment:3 by Nigel, 17 years ago

Resolution: fixed
Status: assignedclosed

(In [18267]) Patch by Erik Hovland to rework isMounted(). Closes #5679

comment:4 by Nigel, 17 years ago

(In [18268]) Correct VERBOSE string (wrong patch). Closes #5679

comment:5 by Stuart Auchterlonie, 17 years ago

Oops. Got the ticket reference wrong.

(In [18672]) Refs #5679. [18266] broke the OSX build. This adds

the necessary code changes to the OSX mediamonitor to allow it to build again.

Note: See TracTickets for help on using tickets.