[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kioslave/media/kdedmodule
From:       Kévin Ottens <ervin () ipsquad ! net>
Date:       2005-03-25 22:02:47
Message-ID: 20050325220247.94DB9626 () office ! kde ! org
[Download RAW message or body]

CVS commit by ervin: 

Looks like someone weird is happening in the kernel. I don't understand
why it spawns processes like this when the device node is not readable.
Those processes are spawned when using open() on the device node.

Anyway, when this open() call fails, it's not necessary to poll the device
anymore. I used to continue but it's generally waste of time. So now the
thread simply give up...

BUGS:102163


  M +6 -4      linuxcdpolling.cpp   1.6
  M +1 -1      linuxcdpolling.h   1.4


--- kdebase/kioslave/media/kdedmodule/linuxcdpolling.cpp  #1.5:1.6
@@ -85,5 +85,6 @@ bool DiscType::isKnownDisc() const
         return m_type != None
             && m_type != Unknown
-            && m_type != UnknownType;
+            && m_type != UnknownType
+            && m_type != Broken;
 }
 
@@ -91,5 +92,6 @@ bool DiscType::isDisc() const
 {
         return m_type != None
-            && m_type != Unknown;
+            && m_type != Unknown
+            && m_type != Broken;
 }
 
@@ -146,5 +148,5 @@ protected:
         {
                 kdDebug() << "PollingThread(" << m_dev << ") start" << endl;
-                while (!m_stop)
+                while (!m_stop && m_lastPollType!=DiscType::Broken)
                 {
                         m_mutex.lock();
@@ -395,5 +397,5 @@ DiscType LinuxCDPolling::identifyDiscTyp
         // open the device
         fd = open(devNode, O_RDONLY | O_NONBLOCK);
-        if (fd < 0) return DiscType::Unknown;
+        if (fd < 0) return DiscType::Broken;
 
         switch (ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT))

--- kdebase/kioslave/media/kdedmodule/linuxcdpolling.h  #1.3:1.4
@@ -30,5 +30,5 @@ class DiscType
 public:
         enum Type { None, Unknown, Audio, Data, DVD, Mixed,
-                    Blank, VCD, SVCD, UnknownType };
+                    Blank, VCD, SVCD, UnknownType, Broken };
 
         DiscType(Type type = Unknown);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic