1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-22 22:58:34 +00:00

infopipe bug fixed; configure/doc updates

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@478 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
Philip Kovacs 2006-01-06 17:49:46 +00:00
parent a53ed0d0ab
commit 43e756287a
6 changed files with 33 additions and 24 deletions

View File

@ -1,5 +1,9 @@
# $Id$
2006-01-06
* Fixed infopipe bug (select() affects timer as a side effect on
Linux!)
2006-01-05
* Added draw_graph_borders option
* Added XMMS/BMP InfoPipe plugin support

3
README
View File

@ -45,7 +45,8 @@ COMPILING
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --enable-xft --enable-seti --enable-dou
ble-buffer --enable-own-window --enable-proc-uptime --enable-mpd
--enable-mldonkey --enable-x11 --enable-portmon
--enable-mldonkey --enable-x11 --enable-portmon --enable-bmpx
--enable-infopipe
make

View File

@ -1,6 +1,6 @@
AC_INIT([Conky],[1.3.6_CVS_20060105],[brenden1@users.sourceforge.net])
AC_INIT([Conky],[1.3.6_CVS_20060106],[brenden1@users.sourceforge.net])
AM_INIT_AUTOMAKE(conky, 1.3.6_CVS_20060105)
AM_INIT_AUTOMAKE(conky, 1.3.6_CVS_20060106)
AM_CONFIG_HEADER(src/config.h)
AC_PROG_LIBTOOL
@ -133,7 +133,7 @@ dnl
want_infopipe=yes
AC_ARG_ENABLE(infopipe,
[ --enable-infopipe enable if you want XMMS/BMP InfoPipe support [[default=no]]],
[ --enable-infopipe enable if you want XMMS/BMP InfoPipe support [[default=yes]]],
[want_infopipe="$enableval"])
AM_CONDITIONAL(BUILD_INFOPIPE, test x$want_infopipe = xyes)

View File

@ -35,7 +35,7 @@ Example to compile and run Conky with all optional components (note that some co
.TP
\fBsh autogen.sh\fR \fB# Only required if building from CVS\fR
.TP
\fB\&./configure \fR\fB\-\-prefix=/usr \-\-mandir=/usr/share/man \-\-infodir=/usr/share/info \-\-datadir=/usr/share \-\-sysconfdir=/etc \-\-localstatedir=/var/lib \-\-enable\-xft \-\-enable\-seti \-\-enable\-double\-buffer \-\-enable\-own\-window \-\-enable\-proc\-uptime \-\-enable\-mpd \-\-enable\-mldonkey \-\-enable\-x11 \-\-enable\-portmon\fR
\fB\&./configure \fR\fB\-\-prefix=/usr \-\-mandir=/usr/share/man \-\-infodir=/usr/share/info \-\-datadir=/usr/share \-\-sysconfdir=/etc \-\-localstatedir=/var/lib \-\-enable\-xft \-\-enable\-seti \-\-enable\-double\-buffer \-\-enable\-own\-window \-\-enable\-proc\-uptime \-\-enable\-mpd \-\-enable\-mldonkey \-\-enable\-x11 \-\-enable\-portmon \-\-enable\-bmpx \-\-enable\-infopipe\fR
.TP
\fBmake\fR
.TP

View File

@ -79,7 +79,7 @@
</varlistentry>
<varlistentry>
<term>
<command><option>./configure </option></command><option>--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-proc-uptime --enable-mpd --enable-mldonkey --enable-x11 --enable-portmon</option>
<command><option>./configure </option></command><option>--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-proc-uptime --enable-mpd --enable-mldonkey --enable-x11 --enable-portmon --enable-bmpx --enable-infopipe</option>
</term>
</varlistentry>
<varlistentry>

View File

@ -65,14 +65,10 @@ void *infopipe_thread_func(void *pvoid)
struct timeval tm;
static char buf[2048]; /* should equal or exceed sizeof(infopipe_t) */
static infopipe_t items;
char *pbuf;
char *pbuf,c;
pvoid=(void*)pvoid; /* useless cast to avoid unused var warning */
/* I/O multiplexing timer */
tm.tv_sec=30; /* high enough to reduce persistent select() failures */
tm.tv_usec=0;
/* Grab the runnable signal. Should be non-zero here or we do nothing. */
pthread_mutex_lock(&info.infopipe.runnable_mutex);
runnable=info.infopipe.runnable;
@ -94,32 +90,40 @@ void *infopipe_thread_func(void *pvoid)
FD_ZERO(&readset);
FD_SET(fd,&readset);
/* The select() below can block for time tm and is ideally suited
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. */
/* On Linux, select() reduces the timer by the amount of time not slept,
* so we must rest the timer with each loop. */
tm.tv_sec=1;
tm.tv_usec=0;
rc=select(fd+1,&readset,NULL,NULL,&tm);
if (rc == -1)
perror("infopipe select()");
else if (rc && FD_ISSET(fd,&readset)) {
if (rc == -1) {
/* -- debug --
perror("infopipe select()");
*/
}
else if (rc && FD_ISSET(fd,&readset)) { /* ready to read */
if (read(fd,buf,sizeof(buf)) > 0) { /* buf has data */
pbuf=buf;
for (i=0;i<14;i++) {
/* 14 lines of key: value pairs presented in a known order */
sscanf(pbuf,"%*[^:]: %[^\n]",items[i]);
while(*pbuf++ != '\n');
if ( sscanf(pbuf,"%*[^:]: %[^\n]",items[i]) == EOF )
break;
while((c = *pbuf++) && (c != '\n'));
}
/* -- debug to console --
/* -- debug --
for(i=0;i<14;i++)
printf("%s\n",items[i]);
*/
}
}
else
printf("no infopipe data to read.\n");
else {
/* -- debug --
printf("no infopipe data\n");
*/
}
close(fd);