Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Do not keep trying to mount when it fails

Refs #10221

If a USB stick (or other removable drive) is attached to the frontend, and the
user running the frontend is not able to mount it with "mount /dev/sdc1" or the
like, we do not want to keep trying (twice a second!) to mount it.  There's
no purpose to that other than extra load, and filling log files with useless
crap.
  • Loading branch information...
commit 1193d2468e7bb110c146aace9c6b24e7d7ac6184 1 parent 4ce95f8
@Beirdo Beirdo authored
Showing with 11 additions and 6 deletions.
  1. +11 −6 mythtv/libs/libmythbase/mythhdd.cpp
View
17 mythtv/libs/libmythbase/mythhdd.cpp
@@ -33,6 +33,9 @@ MythHDD::MythHDD(QObject *par, const char *DevicePath,
*/
MythMediaStatus MythHDD::checkMedia(void)
{
+ if (m_Status == MEDIASTAT_ERROR)
+ return m_Status;
+
if (isMounted())
{
// A lazy way to present volume name for the user to eject.
@@ -40,8 +43,9 @@ MythMediaStatus MythHDD::checkMedia(void)
m_VolumeID = m_MountPath;
// device is mounted, trigger event
- if (MEDIASTAT_MOUNTED != m_Status)
+ if (m_Status != MEDIASTAT_MOUNTED)
m_Status = MEDIASTAT_NOTMOUNTED;
+
return setStatus(MEDIASTAT_MOUNTED);
}
@@ -51,15 +55,16 @@ MythMediaStatus MythHDD::checkMedia(void)
case MEDIASTAT_NOTMOUNTED:
// a removable device was just plugged in try to mount it.
LOG(VB_MEDIA, LOG_INFO, "MythHDD::checkMedia try mounting " + m_DevicePath);
+
if (mount())
- {
- m_Status = MEDIASTAT_NOTMOUNTED;
return setStatus(MEDIASTAT_MOUNTED);
- }
- return m_Status;
+
+ return setStatus(MEDIASTAT_ERROR);
+
case MEDIASTAT_MOUNTED:
// device was mounted and someone unmounted it.
- return m_Status = setStatus(MEDIASTAT_NOTMOUNTED);
+ return setStatus(MEDIASTAT_NOTMOUNTED);
+
default:
// leave device state as is
return m_Status;

0 comments on commit 1193d24

Please sign in to comment.
Something went wrong with that request. Please try again.