infopipe debugging to console and docs correction
authorPhilip Kovacs <pkovacs@users.sourceforge.net>
Fri, 6 Jan 2006 03:44:30 +0000 (03:44 +0000)
committerPhilip Kovacs <pkovacs@users.sourceforge.net>
Fri, 6 Jan 2006 03:44:30 +0000 (03:44 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@475 7f574dfc-610e-0410-a909-a81674777703

README
doc/conky.1
doc/variables.xml
src/infopipe.c

diff --git a/README b/README
index 4659ccf..97e0c3f 100644 (file)
--- a/README
+++ b/README
@@ -655,10 +655,6 @@ VARIABLES
              XMMS/BMP InfoPipe sampling frequency of current tune
 
 
-       infopipe_protocol
-             XMMS/BMP InfoPipe protocol
-
-
        infopipe_playlist_currtune
              XMMS/BMP InfoPipe playlist index number of current tune
 
index fec7e0a..2f1d1f8 100644 (file)
@@ -587,10 +587,6 @@ XMMS/BMP InfoPipe full path and file name of current tune
 XMMS/BMP InfoPipe sampling frequency of current tune
 
 .TP 
-\fBinfopipe_protocol\fR 
-XMMS/BMP InfoPipe protocol
-
-.TP 
 \fBinfopipe_playlist_currtune\fR 
 XMMS/BMP InfoPipe playlist index number of current tune
 
index a965ecf..c7735a6 100644 (file)
 
 <varlistentry>
        <term>
-               <command><option>infopipe_protocol</option></command>
-       </term>
-       <listitem>
-               XMMS/BMP InfoPipe protocol
-       <para></para></listitem>
-</varlistentry>
-
-<varlistentry>
-       <term>
                <command><option>infopipe_playlist_currtune</option></command>
        </term>
        <listitem>
index 0e07504..acb5c53 100644 (file)
@@ -60,7 +60,7 @@ void update_infopipe(void)
  * -------------------------------------------------- */ 
 void *infopipe_thread_func(void *pvoid)
 {
-    int i,fd,runnable;
+    int i,rc,fd,runnable;
     fd_set readset;
     struct timeval tm;
     static char buf[2048];  /* should equal or exceed sizeof(infopipe_t) */
@@ -97,7 +97,10 @@ void *infopipe_thread_func(void *pvoid)
                for a worker thread such as this.  We don't want to slow down
                user interface updates in the main thread as there is already 
               excess latency there. */
-            if (select(fd+1,&readset,NULL,NULL,&tm) == 1) { /* something to read */
+           rc=select(fd+1,&readset,NULL,NULL,&tm);
+           if (rc == -1)
+               perror("infopipe select()");
+           else if (rc && FD_ISSET(fd,&readset)) {
                    
                 if (read(fd,buf,sizeof(buf)) > 0) { /* buf has data */
                    
@@ -112,12 +115,12 @@ void *infopipe_thread_func(void *pvoid)
                    for(i=0;i<14;i++)
                        printf("%s\n",items[i]);
                     */
-               }
+               } 
            }
+           else
+               printf("no infopipe data to read.\n");
 
-           if (close(fd) < 0) {
-                break;
-           }
+           close(fd);
 
            break;
         }