mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-25 04:06:03 +00:00
some fixes
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@87 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
0b8d982116
commit
c1d0dc5ec0
@ -53,7 +53,7 @@
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevpgf77options</f77compiler>
|
||||
<cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -g3</cflags>
|
||||
<cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -g3 -CB</cflags>
|
||||
<envvars/>
|
||||
<topsourcedir></topsourcedir>
|
||||
<cppflags></cppflags>
|
||||
@ -68,18 +68,18 @@
|
||||
<envvars/>
|
||||
<configargs>--enable-debug=full --prefix=/usr --enable-mpd --enable-xft --enable-seti --enable-double-buffer --enable-own-window --enable-metar --enable-mldonkey --disable-x11</configargs>
|
||||
<builddir>debug-no-x</builddir>
|
||||
<topsourcedir></topsourcedir>
|
||||
<cppflags></cppflags>
|
||||
<ldflags></ldflags>
|
||||
<topsourcedir/>
|
||||
<cppflags/>
|
||||
<ldflags/>
|
||||
<ccompiler>kdevgccoptions</ccompiler>
|
||||
<cxxcompiler>kdevgppoptions</cxxcompiler>
|
||||
<f77compiler>kdevpgf77options</f77compiler>
|
||||
<ccompilerbinary></ccompilerbinary>
|
||||
<cxxcompilerbinary></cxxcompilerbinary>
|
||||
<f77compilerbinary></f77compilerbinary>
|
||||
<ccompilerbinary/>
|
||||
<cxxcompilerbinary/>
|
||||
<f77compilerbinary/>
|
||||
<cflags>-O2 -Wall -fexceptions -fomit-frame-pointer -fshort-enums -g3</cflags>
|
||||
<cxxflags></cxxflags>
|
||||
<f77flags></f77flags>
|
||||
<cxxflags/>
|
||||
<f77flags/>
|
||||
</debug-no-x>
|
||||
</configurations>
|
||||
<make>
|
||||
|
2
common.c
2
common.c
@ -33,7 +33,7 @@ FILE *open_file(const char *file, int *reported)
|
||||
FILE *fp = fopen(file, "r");
|
||||
if (!fp) {
|
||||
if (!reported || *reported == 0) {
|
||||
ERR("can't open %s: %s", file, strerror(errno));
|
||||
CRIT_ERR("can't open %s: %s", file, strerror(errno));
|
||||
if (reported)
|
||||
*reported = 1;
|
||||
}
|
||||
|
1
conky.h
1
conky.h
@ -9,6 +9,7 @@
|
||||
#ifndef _conky_h_
|
||||
#define _conky_h_
|
||||
|
||||
#undef MALLOC_CHECK_
|
||||
|
||||
//#include <mcheck.h>
|
||||
#include "config.h"
|
||||
|
2
linux.c
2
linux.c
@ -279,7 +279,7 @@ inline void update_wifi_stats()
|
||||
net_wireless_fp = open_file("/proc/net/wireless", &rep);
|
||||
else
|
||||
fseek(net_wireless_fp, 0, SEEK_SET);
|
||||
if (!net_wireless_fp)
|
||||
if (net_wireless_fp == NULL)
|
||||
return;
|
||||
|
||||
fgets(buf, 255, net_wireless_fp); /* garbage */
|
||||
|
8
top.c
8
top.c
@ -371,7 +371,7 @@ inline static void calc_cpu_each(int total)
|
||||
/*
|
||||
* Result is stored in decreasing order in best[0-9].
|
||||
*/
|
||||
|
||||
#define MAX_TOP_SIZE 400 /* this is plenty big */
|
||||
static struct process **sorttmp;
|
||||
static size_t sorttmp_size = 10;
|
||||
|
||||
@ -408,7 +408,7 @@ inline void process_find_top(struct process **cpu, struct process **mem)
|
||||
if (i < sorttmp_size && pr->counted) {
|
||||
sorttmp[i] = pr;
|
||||
i++;
|
||||
} else if (i == sorttmp_size && pr->counted) {
|
||||
} else if (i == sorttmp_size && pr->counted && sorttmp_size < MAX_TOP_SIZE) {
|
||||
sorttmp_size++;
|
||||
sorttmp =
|
||||
realloc(sorttmp,
|
||||
@ -420,6 +420,7 @@ inline void process_find_top(struct process **cpu, struct process **mem)
|
||||
pr = pr->next;
|
||||
}
|
||||
if (i + 1 < sorttmp_size) {
|
||||
sorttmp_size--;
|
||||
sorttmp =
|
||||
realloc(sorttmp,
|
||||
sizeof(struct process) * sorttmp_size);
|
||||
@ -461,7 +462,7 @@ inline void process_find_top(struct process **cpu, struct process **mem)
|
||||
if (i < sorttmp_size && pr->counted) {
|
||||
sorttmp[i] = pr;
|
||||
i++;
|
||||
} else if (i == sorttmp_size && pr->counted) {
|
||||
} else if (i == sorttmp_size && pr->counted && sorttmp_size < MAX_TOP_SIZE) {
|
||||
sorttmp_size++;
|
||||
sorttmp =
|
||||
realloc(sorttmp,
|
||||
@ -473,6 +474,7 @@ inline void process_find_top(struct process **cpu, struct process **mem)
|
||||
pr = pr->next;
|
||||
}
|
||||
if (i + 1 < sorttmp_size) {
|
||||
sorttmp_size--;
|
||||
sorttmp =
|
||||
realloc(sorttmp,
|
||||
sizeof(struct process) * sorttmp_size);
|
||||
|
Loading…
Reference in New Issue
Block a user