Merge with gkrellm-2.3.3 from upstream
This commit is contained in:
parent
a7ea973741
commit
a9c193f84c
27
Changelog
27
Changelog
|
@ -1,5 +1,32 @@
|
||||||
GKrellM Changelog
|
GKrellM Changelog
|
||||||
-----------------
|
-----------------
|
||||||
|
2.3.3 - Mon Dec 21, 2009
|
||||||
|
------------------------
|
||||||
|
* gkrellm.spec update from Tim Keller.
|
||||||
|
* Patch from Cyrus Rahman: restore gkrellm_sys_main_init() call to proper
|
||||||
|
place and fix FreeBSD sensors for amd64 and fix allocate sensor bug.
|
||||||
|
* Patch from Hajimu Umemoto: add --without-ntlm option
|
||||||
|
* Patches from Hajimu Umemoto for FreeBSD:
|
||||||
|
- Support SMP CPU charts coming in FreeBSD 6.4-RELEASE and 7.1-RELEASE
|
||||||
|
- Use sysctl for swap info on recent FreeBSD; suppress compile warnings
|
||||||
|
- Include patch from Pietro Cerutti for coretemp(4) sensor support and
|
||||||
|
fix bug causing only one instance of a sensor type to be added.
|
||||||
|
- Include patch from Sven Berkvens-Matthijsse to enable battery support
|
||||||
|
on amd64 using ACPI.
|
||||||
|
* Patch from Stefan Gehn: Makefile & configure ntlm detect use pkg-config.
|
||||||
|
* Patch from Erik-Jan: sensors monitor option to show temperature units.
|
||||||
|
* Patch from Hans de Goede: rename getline to gkrellm_getline to avoid
|
||||||
|
conflict with new getline function in recent glibc.
|
||||||
|
* Bugfixes
|
||||||
|
o Fix a crah by moving "unable to connect" Gtk dialogs outside
|
||||||
|
of the connect to client thread.
|
||||||
|
o Divide by zero crash in Linux battery monitor when batteries are dead.
|
||||||
|
o Patch from Hans de Goede: fix a crash by adding openssl mail check
|
||||||
|
locking to mail monitor.
|
||||||
|
* Translation updates
|
||||||
|
o pt_BR.po update from Vinicius Moreira de Oliveira
|
||||||
|
|
||||||
|
|
||||||
2.3.2 - Fri Oct 3, 2008
|
2.3.2 - Fri Oct 3, 2008
|
||||||
------------------------
|
------------------------
|
||||||
* Patch from Stefan Gehn:
|
* Patch from Stefan Gehn:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<h3>Changelog for GKrellM Plugins</h3>
|
<h3>Changelog for GKrellM Plugins</h3>
|
||||||
<hr size="4">
|
<hr size="4">
|
||||||
|
|
||||||
<h4>Changes for versions 2.3.1 - 2.3.2</h4>
|
<h4>Changes for versions 2.3.1 - 2.3.3</h4>
|
||||||
none
|
none
|
||||||
|
|
||||||
<h4>Changes for version 2.3.0</h4>
|
<h4>Changes for version 2.3.0</h4>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
||||||
Changes in 2.2.3 - 2.3.2
|
Changes in 2.2.3 - 2.3.3
|
||||||
------------------------
|
------------------------
|
||||||
None
|
None
|
||||||
|
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -87,7 +87,7 @@ BINMODE = 755
|
||||||
#GTOP_LIBS_D = -L$(GTOP_PREFIX)/lib -lgtop -lgtop_common -lgtop_sysdeps
|
#GTOP_LIBS_D = -L$(GTOP_PREFIX)/lib -lgtop -lgtop_common -lgtop_sysdeps
|
||||||
#export GTOP_INCLUDE GTOP_LIBS GTOP_LIBS_D
|
#export GTOP_INCLUDE GTOP_LIBS GTOP_LIBS_D
|
||||||
|
|
||||||
VERSION = 2.3.2
|
VERSION = 2.3.3
|
||||||
|
|
||||||
INSTALLROOT ?= $(DESTDIR)$(PREFIX)
|
INSTALLROOT ?= $(DESTDIR)$(PREFIX)
|
||||||
|
|
||||||
|
|
2
README
2
README
|
@ -5,7 +5,7 @@ Author: Bill Wilson
|
||||||
Email: billw--at--gkrellm.net
|
Email: billw--at--gkrellm.net
|
||||||
Homepage: http://gkrellm.net
|
Homepage: http://gkrellm.net
|
||||||
|
|
||||||
Copyright (c) 1999-2008 by Bill Wilson. This program is free software
|
Copyright (c) 1999-2009 by Bill Wilson. This program is free software
|
||||||
which I release under the GNU General Public License.
|
which I release under the GNU General Public License.
|
||||||
Read the COPYRIGHT file for more info.
|
Read the COPYRIGHT file for more info.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH gkrellm 1 "Oct 24, 2006" "GNU/Linux" "User's Manual"
|
.TH gkrellm 1 "Dec 21, 2009" "GNU/Linux" "User's Manual"
|
||||||
|
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
gkrellm \- The GNU Krell Monitors
|
gkrellm \- The GNU Krell Monitors
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%define name gkrellm
|
%define name gkrellm
|
||||||
%define version 2.3.2
|
%define version 2.3.3
|
||||||
%define release 1
|
%define release 1
|
||||||
%define prefix /usr
|
%define prefix /usr
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ Summary: Multiple stacked system monitors: 1 process.
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}
|
Release: %{release}
|
||||||
Copyright: GPL
|
License: GPL
|
||||||
Group: X11/Utilities
|
Group: X11/Utilities
|
||||||
URL: http://gkrellm.net
|
URL: http://gkrellm.net
|
||||||
Source: http://members.dslextreme.com/users/billw/gkrellm/%{name}-%{version}.tar.bz2
|
Source: http://members.dslextreme.com/users/billw/gkrellm/%{name}-%{version}.tar.bz2
|
||||||
|
@ -55,6 +55,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||||
%{_mandir}/man1/gkrellm.1.gz
|
%{_mandir}/man1/gkrellm.1.gz
|
||||||
%{_mandir}/man1/gkrellmd.1.gz
|
%{_mandir}/man1/gkrellmd.1.gz
|
||||||
%{_includedir}/gkrellm2/gkrellm*
|
%{_includedir}/gkrellm2/gkrellm*
|
||||||
|
%{_includedir}/gkrellm2/log*
|
||||||
%{_libdir}/pkgconfig/gkrellm.pc
|
%{_libdir}/pkgconfig/gkrellm.pc
|
||||||
%{_datadir}/locale/*/LC_MESSAGES/gkrellm.mo
|
%{_datadir}/locale/*/LC_MESSAGES/gkrellm.mo
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.TH gkrellmd 1 "Oct 24, 2006" "GNU/Linux" "User's Manual"
|
.TH gkrellmd 1 "Dec 21, 2009" "GNU/Linux" "User's Manual"
|
||||||
|
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
gkrellmd \- The GNU Krell Monitors Server
|
gkrellmd \- The GNU Krell Monitors Server
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
In the gkrellm po directory, create the .po template (.pot):
|
In the gkrellm po directory, create the .po template (.pot):
|
||||||
|
|
||||||
xgettext -k_ -kN_ ../src/*.c ../src/sysdeps/*.c -o po/gkrellm.pot
|
xgettext -k_ -kN_ ../src/*.c ../src/sysdeps/*.c -o gkrellm.pot
|
||||||
or
|
or
|
||||||
make enable_nls=1 messages
|
make enable_nls=1 messages
|
||||||
|
|
||||||
|
|
1156
po/gkrellm.pot
1156
po/gkrellm.pot
File diff suppressed because it is too large
Load Diff
2154
po/pt_BR.po
2154
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,7 @@
|
||||||
# Configure some things for gkrellmd when make is run.
|
# Configure some things for gkrellmd when make is run.
|
||||||
# This configure is run automatically so no need to run it by hand.
|
# This configure is run automatically so no need to run it by hand.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2006 Bill Wilson
|
# Copyright (C) 2006-2009 Bill Wilson
|
||||||
|
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
|
@ -36,6 +36,9 @@ int main()
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
|
#if SENSORS_API_VERSION < 0x400 /* libsensors 3 code */
|
||||||
|
FILE *f;
|
||||||
|
|
||||||
f = fopen("/etc/sensors.conf", "r");
|
f = fopen("/etc/sensors.conf", "r");
|
||||||
if (!f)
|
if (!f)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -43,6 +46,11 @@ int main()
|
||||||
return 1;
|
return 1;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 0;
|
return 0;
|
||||||
|
#else /* libsensors 4 code */
|
||||||
|
if (sensors_init(NULL) != 0)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "configure.h"
|
#include "configure.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#define GKRELLMD_VERSION_MAJOR 2
|
#define GKRELLMD_VERSION_MAJOR 2
|
||||||
#define GKRELLMD_VERSION_MINOR 3
|
#define GKRELLMD_VERSION_MINOR 3
|
||||||
#define GKRELLMD_VERSION_REV 2
|
#define GKRELLMD_VERSION_REV 3
|
||||||
#define GKRELLMD_EXTRAVERSION ""
|
#define GKRELLMD_EXTRAVERSION ""
|
||||||
|
|
||||||
#define GKRELLMD_CHECK_VERSION(major,minor,rev) \
|
#define GKRELLMD_CHECK_VERSION(major,minor,rev) \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
#ifndef GKRELLMD_H
|
#ifndef GKRELLMD_H
|
||||||
#define GKRELLMD_H
|
#define GKRELLMD_H
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gkrellmd.h"
|
#include "gkrellmd.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gkrellmd.h"
|
#include "gkrellmd.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gkrellmd.h"
|
#include "gkrellmd.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gkrellmd.h"
|
#include "gkrellmd.h"
|
||||||
|
@ -669,7 +681,7 @@ update_inet(GkrellmdMonitor *mon, gboolean first_update)
|
||||||
InetData *in;
|
InetData *in;
|
||||||
static gint check_tcp;
|
static gint check_tcp;
|
||||||
|
|
||||||
|
|
||||||
if (!first_update && !GK.second_tick)
|
if (!first_update && !GK.second_tick)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1008,7 +1020,7 @@ update_net(GkrellmdMonitor *mon, gboolean first_update)
|
||||||
gkrellm_sys_net_check_routes();
|
gkrellm_sys_net_check_routes();
|
||||||
}
|
}
|
||||||
gkrellm_sys_net_read_data();
|
gkrellm_sys_net_read_data();
|
||||||
|
|
||||||
if (GK.second_tick && !net_use_routed)
|
if (GK.second_tick && !net_use_routed)
|
||||||
{
|
{
|
||||||
for (list = net_list; list; list = list->next)
|
for (list = net_list; list; list = list->next)
|
||||||
|
@ -2184,7 +2196,7 @@ gkrellmd_update_monitors(void)
|
||||||
}
|
}
|
||||||
gkrellmd_send_to_client(client, serve_gstring->str);
|
gkrellmd_send_to_client(client, serve_gstring->str);
|
||||||
serve_gstring = g_string_truncate(serve_gstring, 0);
|
serve_gstring = g_string_truncate(serve_gstring, 0);
|
||||||
|
|
||||||
if (GK.minute_tick || !client->served)
|
if (GK.minute_tick || !client->served)
|
||||||
send_time(client);
|
send_time(client);
|
||||||
else if (GK.second_tick)
|
else if (GK.second_tick)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gkrellmd.h"
|
#include "gkrellmd.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gkrellmd.h"
|
#include "gkrellmd.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -17,6 +17,18 @@
|
||||||
|
|
|
|
||||||
| You should have received a copy of the GNU General Public License
|
| You should have received a copy of the GNU General Public License
|
||||||
| along with this program. If not, see http://www.gnu.org/licenses/
|
| along with this program. If not, see http://www.gnu.org/licenses/
|
||||||
|
|
|
||||||
|
|
|
||||||
|
| Additional permission under GNU GPL version 3 section 7
|
||||||
|
|
|
||||||
|
| If you modify this program, or any covered work, by linking or
|
||||||
|
| combining it with the OpenSSL project's OpenSSL library (or a
|
||||||
|
| modified version of that library), containing parts covered by
|
||||||
|
| the terms of the OpenSSL or SSLeay licenses, you are granted
|
||||||
|
| additional permission to convey the resulting work.
|
||||||
|
| Corresponding Source for a non-source form of such a combination
|
||||||
|
| shall include the source code for the parts of OpenSSL used as well
|
||||||
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "gkrellmd.h"
|
#include "gkrellmd.h"
|
||||||
|
|
|
@ -29,7 +29,7 @@ BEGIN
|
||||||
VALUE "FileDescription", "GKrellM Daemon"
|
VALUE "FileDescription", "GKrellM Daemon"
|
||||||
VALUE "FileVersion", RC_VER_STRING
|
VALUE "FileVersion", RC_VER_STRING
|
||||||
VALUE "InternalName", "gkrellmd"
|
VALUE "InternalName", "gkrellmd"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 1999-2008 Bill Wilson"
|
VALUE "LegalCopyright", "Copyright (C) 1999-2009 Bill Wilson"
|
||||||
VALUE "OriginalFilename", "gkrellmd.exe"
|
VALUE "OriginalFilename", "gkrellmd.exe"
|
||||||
VALUE "ProductName", "GKrellM"
|
VALUE "ProductName", "GKrellM"
|
||||||
VALUE "ProductVersion", RC_VER_STRING
|
VALUE "ProductVersion", RC_VER_STRING
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Stefan Gehn stefan.gkrellm@srcbox.net
|
| Author: Stefan Gehn stefan.gkrellm@srcbox.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
* Copyright (C) 1999-2008 Bill Wilson
|
* Copyright (C) 1999-2009 Bill Wilson
|
||||||
*
|
*
|
||||||
* @author Bill Wilson <billw@gkrellm.net>
|
* @author Bill Wilson <billw@gkrellm.net>
|
||||||
*
|
*
|
||||||
|
|
|
@ -45,6 +45,12 @@ endif
|
||||||
ifeq ($(without-libsensors),1)
|
ifeq ($(without-libsensors),1)
|
||||||
CONFIGURE_ARGS += --without-libsensors
|
CONFIGURE_ARGS += --without-libsensors
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(without-ntlm),yes)
|
||||||
|
CONFIGURE_ARGS += --without-ntlm
|
||||||
|
endif
|
||||||
|
ifeq ($(without-ntlm),1)
|
||||||
|
CONFIGURE_ARGS += --without-ntlm
|
||||||
|
endif
|
||||||
DUMMY_VAR := $(shell ./configure $(CONFIGURE_ARGS))
|
DUMMY_VAR := $(shell ./configure $(CONFIGURE_ARGS))
|
||||||
|
|
||||||
HAVE_GNUTLS = $(shell grep -c HAVE_GNUTLS configure.h)
|
HAVE_GNUTLS = $(shell grep -c HAVE_GNUTLS configure.h)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
12
src/chart.c
12
src/chart.c
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -67,7 +67,7 @@ static gint
|
||||||
computed_index(GkrellmChart *cp, gint i)
|
computed_index(GkrellmChart *cp, gint i)
|
||||||
{
|
{
|
||||||
gint x;
|
gint x;
|
||||||
|
|
||||||
x = (cp->position + i + 1) % cp->w;
|
x = (cp->position + i + 1) % cp->w;
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ chartdata_ycoord(GkrellmChart *cp, GkrellmChartdata *cd, gint yd)
|
||||||
{
|
{
|
||||||
glong y;
|
glong y;
|
||||||
guint64 Y;
|
guint64 Y;
|
||||||
|
|
||||||
if (cp->scale_max <= 0)
|
if (cp->scale_max <= 0)
|
||||||
cp->scale_max = 1;
|
cp->scale_max = 1;
|
||||||
|
|
||||||
|
@ -1173,7 +1173,7 @@ gkrellm_draw_chart_text(GkrellmChart *cp, gint style_id, gchar *str)
|
||||||
buf[text_length] = '\0';
|
buf[text_length] = '\0';
|
||||||
printf("draw_chart_text: [%s] ", buf);
|
printf("draw_chart_text: [%s] ", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = cp->baseline_ref - tr->baseline; /* align baselines */
|
offset = cp->baseline_ref - tr->baseline; /* align baselines */
|
||||||
if (_GK.chart_text_no_fill)
|
if (_GK.chart_text_no_fill)
|
||||||
gkrellm_draw_text(cp->pixmap, ts, x, y + offset, s,
|
gkrellm_draw_text(cp->pixmap, ts, x, y + offset, s,
|
||||||
|
@ -1844,7 +1844,7 @@ gkrellm_chart_create(GtkWidget *vbox, GkrellmMonitor *mon, GkrellmChart *cp,
|
||||||
cp->config->chart_cd_list = &cp->cd_list;
|
cp->config->chart_cd_list = &cp->cd_list;
|
||||||
|
|
||||||
if (!cp->box)
|
if (!cp->box)
|
||||||
{
|
{
|
||||||
cp->box = gtk_vbox_new(FALSE, 0); /* not a hbox anymore !! */
|
cp->box = gtk_vbox_new(FALSE, 0); /* not a hbox anymore !! */
|
||||||
gtk_box_pack_start(GTK_BOX(vbox), cp->box, FALSE, FALSE, 0);
|
gtk_box_pack_start(GTK_BOX(vbox), cp->box, FALSE, FALSE, 0);
|
||||||
|
|
||||||
|
@ -2025,7 +2025,7 @@ set_grid_resolution_spin_button(GkrellmChart *cp, gint res)
|
||||||
if (!cp || !cp->config_window || !cp->config->grid_resolution_spin_button)
|
if (!cp || !cp->config_window || !cp->config->grid_resolution_spin_button)
|
||||||
return;
|
return;
|
||||||
spin = GTK_SPIN_BUTTON(cp->config->grid_resolution_spin_button);
|
spin = GTK_SPIN_BUTTON(cp->config->grid_resolution_spin_button);
|
||||||
gtk_spin_button_set_value(spin, (gfloat) res);
|
gtk_spin_button_set_value(spin, (gfloat) res);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
36
src/client.c
36
src/client.c
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -1620,7 +1620,7 @@ KeyTable update_table[] =
|
||||||
|
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
getline(gint fd, gchar *buf, gint len)
|
gkrellm_getline(gint fd, gchar *buf, gint len)
|
||||||
{
|
{
|
||||||
fd_set read_fds;
|
fd_set read_fds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
@ -1714,7 +1714,7 @@ read_server_setup(gint fd)
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
rs=getline(fd, buf, sizeof(buf));
|
rs=gkrellm_getline(fd, buf, sizeof(buf));
|
||||||
if(rs<0)
|
if(rs<0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!strcmp(buf, "</gkrellmd_setup>"))
|
if (!strcmp(buf, "</gkrellmd_setup>"))
|
||||||
|
@ -1732,7 +1732,7 @@ read_server_setup(gint fd)
|
||||||
table_size = sizeof(update_table) / sizeof(KeyTable);
|
table_size = sizeof(update_table) / sizeof(KeyTable);
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
rs=getline(fd, buf, sizeof(buf));
|
rs=gkrellm_getline(fd, buf, sizeof(buf));
|
||||||
if(rs<0)
|
if(rs<0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!strcmp(buf, "</initial_update>"))
|
if (!strcmp(buf, "</initial_update>"))
|
||||||
|
@ -1870,7 +1870,7 @@ gkrellm_connect_to(gchar *server, gint server_port)
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
enum GkrellmConnectResult
|
||||||
gkrellm_client_mode_connect(void)
|
gkrellm_client_mode_connect(void)
|
||||||
{
|
{
|
||||||
gchar buf[128];
|
gchar buf[128];
|
||||||
|
@ -1879,10 +1879,8 @@ gkrellm_client_mode_connect(void)
|
||||||
_GK.server_port = GKRELLMD_SERVER_PORT;
|
_GK.server_port = GKRELLMD_SERVER_PORT;
|
||||||
|
|
||||||
client_fd = gkrellm_connect_to(_GK.server, _GK.server_port);
|
client_fd = gkrellm_connect_to(_GK.server, _GK.server_port);
|
||||||
if (client_fd < 0) {
|
if (client_fd < 0)
|
||||||
g_warning("%s\n", _("Unable to connect."));
|
return BAD_CONNECT;
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "gkrellm %d.%d.%d%s\n",
|
snprintf(buf, sizeof(buf), "gkrellm %d.%d.%d%s\n",
|
||||||
GKRELLM_VERSION_MAJOR, GKRELLM_VERSION_MINOR,
|
GKRELLM_VERSION_MAJOR, GKRELLM_VERSION_MINOR,
|
||||||
|
@ -1891,11 +1889,11 @@ gkrellm_client_mode_connect(void)
|
||||||
|
|
||||||
/* Initial setup lines from server are read in blocking mode.
|
/* Initial setup lines from server are read in blocking mode.
|
||||||
*/
|
*/
|
||||||
if(!read_server_setup(client_fd)){
|
if(!read_server_setup(client_fd))
|
||||||
|
{
|
||||||
close(client_fd);
|
close(client_fd);
|
||||||
return FALSE;
|
return BAD_SETUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extra stuff not handled in read_server_setup()
|
/* Extra stuff not handled in read_server_setup()
|
||||||
*/
|
*/
|
||||||
|
@ -1911,23 +1909,23 @@ gkrellm_client_mode_connect(void)
|
||||||
|
|
||||||
server_alive = TRUE;
|
server_alive = TRUE;
|
||||||
|
|
||||||
return TRUE;
|
return GOOD_CONNECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gboolean client_mode_thread_busy;
|
static gboolean client_mode_thread_busy;
|
||||||
|
|
||||||
gint
|
enum GkrellmConnectState
|
||||||
gkrellm_client_server_connect_state(void)
|
gkrellm_client_server_connect_state(void)
|
||||||
{
|
{
|
||||||
if (client_mode_thread_busy) /* reconnect in progress? */
|
if (client_mode_thread_busy) /* reconnect in progress? */
|
||||||
return 2;
|
return CONNECTING;
|
||||||
if (_GK.client_mode && client_input_id > 0) /* Currently connected? */
|
if (_GK.client_mode && client_input_id > 0) /* Currently connected? */
|
||||||
return 1;
|
return CONNECTED;
|
||||||
else if (_GK.client_mode)
|
else if (_GK.client_mode)
|
||||||
return 0;
|
return DISCONNECTED;
|
||||||
else
|
else
|
||||||
return -1;
|
return NO_CLIENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# Configure some things for GKrellM when make is run.
|
# Configure some things for GKrellM when make is run.
|
||||||
# This configure is run automatically so no need to run it by hand.
|
# This configure is run automatically so no need to run it by hand.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003 Bill Wilson
|
# Copyright (C) 2003-2009 Bill Wilson
|
||||||
|
|
||||||
for i
|
for i
|
||||||
do
|
do
|
||||||
|
@ -19,6 +19,10 @@ do
|
||||||
then
|
then
|
||||||
without_libsensors=yes
|
without_libsensors=yes
|
||||||
fi
|
fi
|
||||||
|
if [ "$i" = "--without-ntlm" ]
|
||||||
|
then
|
||||||
|
without_ntlm=yes
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
PKG_INCLUDE=`pkg-config gtk+-2.0 --cflags`
|
PKG_INCLUDE=`pkg-config gtk+-2.0 --cflags`
|
||||||
|
@ -121,6 +125,8 @@ fi
|
||||||
|
|
||||||
rm -f test test.exe test.o test.c
|
rm -f test test.exe test.o test.c
|
||||||
|
|
||||||
|
if [ "$without_ntlm" != "yes" ]
|
||||||
|
then
|
||||||
# echo "Checking for libntlm... " 1>& 2
|
# echo "Checking for libntlm... " 1>& 2
|
||||||
echo "Checking for libntlm... " 1>& 5
|
echo "Checking for libntlm... " 1>& 5
|
||||||
|
|
||||||
|
@ -151,7 +157,8 @@ else
|
||||||
# echo "Not found, mail check will not have ntlm support..." 1>& 2
|
# echo "Not found, mail check will not have ntlm support..." 1>& 2
|
||||||
echo "Not found, mail check will not have ntlm support..." 1>& 5
|
echo "Not found, mail check will not have ntlm support..." 1>& 5
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
# end of ntlm check
|
||||||
|
|
||||||
|
|
||||||
rm -f test test.exe test.o test.c
|
rm -f test test.exe test.o test.c
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
4
src/fs.c
4
src/fs.c
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -1354,7 +1354,7 @@ fstab_user_permission(Mount *m)
|
||||||
{
|
{
|
||||||
struct stat my_stat;
|
struct stat my_stat;
|
||||||
|
|
||||||
g_stat(m->device, &my_stat);
|
stat(m->device, &my_stat);
|
||||||
if ( strstr(m->options, "user")
|
if ( strstr(m->options, "user")
|
||||||
|| (strstr(m->options, "owner") && my_stat.st_uid == uid)
|
|| (strstr(m->options, "owner") && my_stat.st_uid == uid)
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -49,6 +49,21 @@
|
||||||
|
|
||||||
#define GKRELLM_FLOAT_FACTOR 1000.0
|
#define GKRELLM_FLOAT_FACTOR 1000.0
|
||||||
|
|
||||||
|
enum GkrellmConnectResult
|
||||||
|
{
|
||||||
|
GOOD_CONNECT,
|
||||||
|
BAD_CONNECT,
|
||||||
|
BAD_SETUP
|
||||||
|
};
|
||||||
|
|
||||||
|
enum GkrellmConnectState
|
||||||
|
{
|
||||||
|
CONNECTING,
|
||||||
|
CONNECTED,
|
||||||
|
DISCONNECTED,
|
||||||
|
NO_CLIENT
|
||||||
|
};
|
||||||
|
|
||||||
enum GkrellmState
|
enum GkrellmState
|
||||||
{
|
{
|
||||||
INITIALIZING,
|
INITIALIZING,
|
||||||
|
@ -488,10 +503,12 @@ void gkrellm_winop_state_below(gboolean);
|
||||||
|
|
||||||
/* client */
|
/* client */
|
||||||
gint gkrellm_connect_to(gchar *, gint);
|
gint gkrellm_connect_to(gchar *, gint);
|
||||||
gboolean gkrellm_client_mode_connect(void);
|
enum GkrellmConnectResult
|
||||||
|
gkrellm_client_mode_connect(void);
|
||||||
void gkrellm_client_mode_disconnect(void);
|
void gkrellm_client_mode_disconnect(void);
|
||||||
struct tm *gkrellm_client_server_time(void);
|
struct tm *gkrellm_client_server_time(void);
|
||||||
gint gkrellm_client_server_connect_state(void);
|
enum GkrellmConnectState
|
||||||
|
gkrellm_client_server_connect_state(void);
|
||||||
void gkrellm_client_mode_connect_thread(void);
|
void gkrellm_client_mode_connect_thread(void);
|
||||||
gint gkrellm_client_server_get_net_timer(void);
|
gint gkrellm_client_server_get_net_timer(void);
|
||||||
|
|
||||||
|
|
|
@ -270,7 +270,7 @@ GkrellmDecalbutton *gkrellm_make_scaled_button(GkrellmPanel *p,
|
||||||
gboolean auto_hide, gboolean set_default_border,
|
gboolean auto_hide, gboolean set_default_border,
|
||||||
gint depth, gint cur_index, gint pressed_index,
|
gint depth, gint cur_index, gint pressed_index,
|
||||||
gint x, gint y, gint w, gint h);
|
gint x, gint y, gint w, gint h);
|
||||||
|
|
||||||
GkrellmDecalbutton *gkrellm_decal_is_button(GkrellmDecal *);
|
GkrellmDecalbutton *gkrellm_decal_is_button(GkrellmDecal *);
|
||||||
void gkrellm_set_in_button_callback(GkrellmDecalbutton *,
|
void gkrellm_set_in_button_callback(GkrellmDecalbutton *,
|
||||||
gint (*func)(), gpointer data);
|
gint (*func)(), gpointer data);
|
||||||
|
@ -572,7 +572,7 @@ gboolean gkrellm_disk_temperature_display(gpointer sr, gchar *disk_name,
|
||||||
gfloat t, gchar units);
|
gfloat t, gchar units);
|
||||||
void gkrellm_disk_temperature_remove(gchar *disk_name);
|
void gkrellm_disk_temperature_remove(gchar *disk_name);
|
||||||
|
|
||||||
|
|
||||||
/* Functions exported by net.c
|
/* Functions exported by net.c
|
||||||
*/
|
*/
|
||||||
gint gkrellm_net_routes(void);
|
gint gkrellm_net_routes(void);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
#define GKRELLM_VERSION_MAJOR 2
|
#define GKRELLM_VERSION_MAJOR 2
|
||||||
#define GKRELLM_VERSION_MINOR 3
|
#define GKRELLM_VERSION_MINOR 3
|
||||||
#define GKRELLM_VERSION_REV 2
|
#define GKRELLM_VERSION_REV 3
|
||||||
#define GKRELLM_EXTRAVERSION ""
|
#define GKRELLM_EXTRAVERSION ""
|
||||||
|
|
||||||
#define GKRELLM_CHECK_VERSION(major,minor,rev) \
|
#define GKRELLM_CHECK_VERSION(major,minor,rev) \
|
||||||
|
|
12
src/gui.c
12
src/gui.c
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -768,7 +768,7 @@ create_about_tab(GtkWidget *vbox)
|
||||||
gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
|
||||||
|
|
||||||
buf = g_strdup_printf(_("GKrellM %d.%d.%d%s\nGNU Krell Monitors\n\n"
|
buf = g_strdup_printf(_("GKrellM %d.%d.%d%s\nGNU Krell Monitors\n\n"
|
||||||
"Copyright (c) 1999-2007 by Bill Wilson\n"
|
"Copyright (c) 1999-2009 by Bill Wilson\n"
|
||||||
"billw@gkrellm.net\n"
|
"billw@gkrellm.net\n"
|
||||||
"http://gkrellm.net\n\n"
|
"http://gkrellm.net\n\n"
|
||||||
"Released under the GNU General Public License"),
|
"Released under the GNU General Public License"),
|
||||||
|
@ -1140,7 +1140,7 @@ _("Make gkrellm a topmost window (restart gkrellm for this to take effect)."));
|
||||||
vbox2 = gkrellm_gtk_framed_vbox(vbox1, NULL, 0, FALSE, 0, 0);
|
vbox2 = gkrellm_gtk_framed_vbox(vbox1, NULL, 0, FALSE, 0, 0);
|
||||||
gkrellm_gtk_check_button_connected(vbox2, &dock_type_button,
|
gkrellm_gtk_check_button_connected(vbox2, &dock_type_button,
|
||||||
_GK.dock_type, FALSE, FALSE, 0,
|
_GK.dock_type, FALSE, FALSE, 0,
|
||||||
cb_dock_type, NULL,
|
cb_dock_type, NULL,
|
||||||
_("Set window type to be a dock or panel"));
|
_("Set window type to be a dock or panel"));
|
||||||
|
|
||||||
vbox2 = gkrellm_gtk_framed_vbox(vbox1, NULL, 0, FALSE, 0, 0);
|
vbox2 = gkrellm_gtk_framed_vbox(vbox1, NULL, 0, FALSE, 0, 0);
|
||||||
|
@ -1615,7 +1615,7 @@ gkrellm_load_theme_config(void)
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
/* Need to load the theme from ~/.gkrellm/theme_config only at startup
|
/* Need to load the theme from ~/.gkrellm/theme_config only at startup
|
||||||
| or if re-reading because of theme_event - these are only times
|
| or if re-reading because of theme_event - these are only times
|
||||||
| _GK.theme_path will be NULL. Note: _GK.theme_path will not be NULL
|
| _GK.theme_path will be NULL. Note: _GK.theme_path will not be NULL
|
||||||
| at startup if there is a command line theme, so no theme scaling if
|
| at startup if there is a command line theme, so no theme scaling if
|
||||||
| using command line theme.
|
| using command line theme.
|
||||||
|
@ -2299,7 +2299,7 @@ create_config_window(void)
|
||||||
GList *list;
|
GList *list;
|
||||||
GkrellmMonitor *mon;
|
GkrellmMonitor *mon;
|
||||||
gchar *config_name, *window_title;
|
gchar *config_name, *window_title;
|
||||||
|
|
||||||
if (config_window)
|
if (config_window)
|
||||||
{
|
{
|
||||||
gtk_window_present(GTK_WINDOW(config_window));
|
gtk_window_present(GTK_WINDOW(config_window));
|
||||||
|
@ -2320,7 +2320,7 @@ create_config_window(void)
|
||||||
gtk_window_set_wmclass(GTK_WINDOW(config_window),
|
gtk_window_set_wmclass(GTK_WINDOW(config_window),
|
||||||
"Gkrellm_conf", "Gkrellm");
|
"Gkrellm_conf", "Gkrellm");
|
||||||
gtk_container_set_border_width(GTK_CONTAINER(config_window), 2);
|
gtk_container_set_border_width(GTK_CONTAINER(config_window), 2);
|
||||||
|
|
||||||
config_hbox = gtk_hbox_new(FALSE, 4);
|
config_hbox = gtk_hbox_new(FALSE, 4);
|
||||||
gtk_container_add(GTK_CONTAINER(config_window), config_hbox);
|
gtk_container_add(GTK_CONTAINER(config_window), config_hbox);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -254,11 +254,12 @@ draw_sysname(void)
|
||||||
void
|
void
|
||||||
update_host(void)
|
update_host(void)
|
||||||
{
|
{
|
||||||
gchar **parts;
|
gchar **parts;
|
||||||
gint connect_state, delta, step, h_scroll;
|
gint delta, step, h_scroll;
|
||||||
gint hz = gkrellm_update_HZ();
|
gint hz = gkrellm_update_HZ();
|
||||||
static gint reconnect_timeout, y_target, asym;
|
static gint reconnect_timeout, y_target, asym;
|
||||||
static gboolean recheck_sysname;
|
static gboolean recheck_sysname;
|
||||||
|
enum GkrellmConnectState connect_state;
|
||||||
|
|
||||||
if (decal_sysname && system_name_mode == 1 && system_dtext.reduced)
|
if (decal_sysname && system_name_mode == 1 && system_dtext.reduced)
|
||||||
{
|
{
|
||||||
|
@ -295,7 +296,7 @@ update_host(void)
|
||||||
/* If we loose the server connection, trigger a hardwired alarm.
|
/* If we loose the server connection, trigger a hardwired alarm.
|
||||||
*/
|
*/
|
||||||
connect_state = gkrellm_client_server_connect_state();
|
connect_state = gkrellm_client_server_connect_state();
|
||||||
if (connect_state == 2) /* thread is trying a reconnect */
|
if (connect_state == CONNECTING) /* thread is trying a reconnect */
|
||||||
{
|
{
|
||||||
if (_GK.client_server_reconnect_timeout <= 0)
|
if (_GK.client_server_reconnect_timeout <= 0)
|
||||||
{
|
{
|
||||||
|
@ -303,7 +304,7 @@ update_host(void)
|
||||||
draw_sysname();
|
draw_sysname();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (connect_state == 0) /* Lost connection */
|
else if (connect_state == DISCONNECTED) /* Lost connection */
|
||||||
{
|
{
|
||||||
gkrellm_check_alert(server_alert, 2.0); /* Alarm */
|
gkrellm_check_alert(server_alert, 2.0); /* Alarm */
|
||||||
if ( _GK.client_server_reconnect_timeout > 0
|
if ( _GK.client_server_reconnect_timeout > 0
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
75
src/mail.c
75
src/mail.c
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -115,7 +115,7 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
||||||
/* Here's the list of all the mailbox types the Mail monitor knows about.
|
/* Here's the list of all the mailbox types the Mail monitor knows about.
|
||||||
| The MBOX_FETCH is a pseudo internal mailbox where the counts read from
|
| The MBOX_FETCH is a pseudo internal mailbox where the counts read from
|
||||||
| the fetch program are kept. Additionally MBOX_FETCH_TOOLTIP types
|
| the fetch program are kept. Additionally MBOX_FETCH_TOOLTIP types
|
||||||
| are constructed just so the fetch programs output lines can be
|
| are constructed just so the fetch programs output lines can be
|
||||||
| reported in a tooltip. Real mailboxes that GKrellM creates in its
|
| reported in a tooltip. Real mailboxes that GKrellM creates in its
|
||||||
| config and knows how to check have MBOX_INTERNAL set. And
|
| config and knows how to check have MBOX_INTERNAL set. And
|
||||||
| finally there can be external (plugin) mailboxes created which
|
| finally there can be external (plugin) mailboxes created which
|
||||||
|
@ -306,6 +306,21 @@ static gint anim_frame,
|
||||||
|
|
||||||
static gint style_id;
|
static gint style_id;
|
||||||
|
|
||||||
|
#ifdef HAVE_SSL
|
||||||
|
#ifndef HAVE_GNUTLS
|
||||||
|
static GMutex **ssl_locks;
|
||||||
|
|
||||||
|
static void
|
||||||
|
ssl_locking_cb(int mode, int n, const char *file, int line)
|
||||||
|
{
|
||||||
|
if (mode & CRYPTO_LOCK)
|
||||||
|
g_mutex_lock(ssl_locks[n]);
|
||||||
|
else
|
||||||
|
g_mutex_unlock(ssl_locks[n]);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This may be called from gkrellm_sys_main_init()
|
/* This may be called from gkrellm_sys_main_init()
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
@ -390,7 +405,7 @@ update_tooltip(void)
|
||||||
MailAccount *account;
|
MailAccount *account;
|
||||||
GString *mboxes = NULL;
|
GString *mboxes = NULL;
|
||||||
gchar buf[128];
|
gchar buf[128];
|
||||||
|
|
||||||
if (show_tooltip)
|
if (show_tooltip)
|
||||||
{
|
{
|
||||||
mboxes = g_string_sized_new(512);
|
mboxes = g_string_sized_new(512);
|
||||||
|
@ -412,10 +427,10 @@ update_tooltip(void)
|
||||||
else if (! format_remote_mbox_name(mbox, buf, sizeof(buf)))
|
else if (! format_remote_mbox_name(mbox, buf, sizeof(buf)))
|
||||||
continue; /* Can't get a name, so no tooltip for you! */
|
continue; /* Can't get a name, so no tooltip for you! */
|
||||||
|
|
||||||
if (mboxes->len > 0)
|
if (mboxes->len > 0)
|
||||||
g_string_append_c(mboxes, '\n');
|
g_string_append_c(mboxes, '\n');
|
||||||
g_string_append(mboxes, buf);
|
g_string_append(mboxes, buf);
|
||||||
|
|
||||||
if (count_mode == MSG_NEW_TOTAL_COUNT)
|
if (count_mode == MSG_NEW_TOTAL_COUNT)
|
||||||
snprintf(buf, sizeof(buf), "(%d/%d)",
|
snprintf(buf, sizeof(buf), "(%d/%d)",
|
||||||
mbox->new_mail_count, mbox->mail_count);
|
mbox->new_mail_count, mbox->mail_count);
|
||||||
|
@ -429,7 +444,7 @@ update_tooltip(void)
|
||||||
if (show_tooltip && mboxes && mboxes->len > 0)
|
if (show_tooltip && mboxes && mboxes->len > 0)
|
||||||
{
|
{
|
||||||
#if GTK_CHECK_VERSION(2,12,0)
|
#if GTK_CHECK_VERSION(2,12,0)
|
||||||
gtk_widget_set_tooltip_text(mail->drawing_area, mboxes->str);
|
gtk_widget_set_tooltip_text(mail->drawing_area, mboxes->str);
|
||||||
#else
|
#else
|
||||||
gtk_tooltips_set_tip(tooltip, mail->drawing_area, mboxes->str, "");
|
gtk_tooltips_set_tip(tooltip, mail->drawing_area, mboxes->str, "");
|
||||||
gtk_tooltips_enable(tooltip);
|
gtk_tooltips_enable(tooltip);
|
||||||
|
@ -447,8 +462,8 @@ update_tooltip(void)
|
||||||
if (mboxes)
|
if (mboxes)
|
||||||
g_string_free(mboxes, TRUE);
|
g_string_free(mboxes, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Look at a From line to see if it is valid, lines look like:
|
/* Look at a From line to see if it is valid, lines look like:
|
||||||
| From sending_address dayofweek month dayofmonth timeofday year
|
| From sending_address dayofweek month dayofmonth timeofday year
|
||||||
| eg: From billw@gkrellm.net Fri Oct 22 13:52:49 2010
|
| eg: From billw@gkrellm.net Fri Oct 22 13:52:49 2010
|
||||||
|
@ -490,7 +505,7 @@ is_multipart_mail(gchar *buf, gchar *separator)
|
||||||
gchar *fieldstart;
|
gchar *fieldstart;
|
||||||
gchar *sepstart;
|
gchar *sepstart;
|
||||||
gint seplen;
|
gint seplen;
|
||||||
|
|
||||||
if (strncmp(buf, "Content-Type: ", 14) != 0)
|
if (strncmp(buf, "Content-Type: ", 14) != 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (strncmp(&buf[14], "multipart/", 10) != 0)
|
if (strncmp(&buf[14], "multipart/", 10) != 0)
|
||||||
|
@ -750,9 +765,6 @@ ssl_negotiate(ConnInfo *conn, Mailbox *mbox)
|
||||||
{
|
{
|
||||||
SSL_METHOD *ssl_method;
|
SSL_METHOD *ssl_method;
|
||||||
|
|
||||||
SSLeay_add_ssl_algorithms();
|
|
||||||
SSL_load_error_strings();
|
|
||||||
|
|
||||||
if (mbox->account->use_ssl == SSL_TRANSPORT)
|
if (mbox->account->use_ssl == SSL_TRANSPORT)
|
||||||
ssl_method = SSLv23_client_method();
|
ssl_method = SSLv23_client_method();
|
||||||
else
|
else
|
||||||
|
@ -1228,7 +1240,7 @@ check_imap(Mailbox *mbox)
|
||||||
return tcp_shutdown(&conn, mbox, tcp_error_message[4], FALSE);
|
return tcp_shutdown(&conn, mbox, tcp_error_message[4], FALSE);
|
||||||
if ((ss = strstr(mbox->tcp_in->str, "MESSAGES")) == NULL)
|
if ((ss = strstr(mbox->tcp_in->str, "MESSAGES")) == NULL)
|
||||||
return tcp_shutdown(&conn, mbox, tcp_error_message[4], FALSE);
|
return tcp_shutdown(&conn, mbox, tcp_error_message[4], FALSE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return tcp_shutdown(&conn, mbox, tcp_error_message[4], FALSE);
|
return tcp_shutdown(&conn, mbox, tcp_error_message[4], FALSE);
|
||||||
}
|
}
|
||||||
|
@ -1323,7 +1335,7 @@ sylpheed_mark_new_count(Mailbox *mbox)
|
||||||
|
|
||||||
if (!f)
|
if (!f)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( fread(&ver, sizeof(ver), 1, f) == 1
|
if ( fread(&ver, sizeof(ver), 1, f) == 1
|
||||||
&& SYLPHEED_MARK_VERSION == ver
|
&& SYLPHEED_MARK_VERSION == ver
|
||||||
)
|
)
|
||||||
|
@ -1448,12 +1460,12 @@ check_maildir(Mailbox *mbox)
|
||||||
| And Netscape mail does status with X-Mozilla-Status: xxxS
|
| And Netscape mail does status with X-Mozilla-Status: xxxS
|
||||||
| where S is bitwise or of status flags:
|
| where S is bitwise or of status flags:
|
||||||
| 1: read 2: replied 4: marked 8: deleted
|
| 1: read 2: replied 4: marked 8: deleted
|
||||||
|
|
|
|
||||||
| Evolution uses status with X-Evolution: 00000000-xxxx where xxxx status is
|
| Evolution uses status with X-Evolution: 00000000-xxxx where xxxx status is
|
||||||
| a bitfield in hexadecimal (see enum _CamelMessageFlags in evolution/camel
|
| a bitfield in hexadecimal (see enum _CamelMessageFlags in evolution/camel
|
||||||
| source) and most importantly CAMEL_MESSAGE_SEEN = 1<<4.
|
| source) and most importantly CAMEL_MESSAGE_SEEN = 1<<4.
|
||||||
*/
|
*/
|
||||||
/* test if buf is a status for standard mail, mozilla or evolution
|
/* test if buf is a status for standard mail, mozilla or evolution
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
is_status(gchar *buf)
|
is_status(gchar *buf)
|
||||||
|
@ -1505,7 +1517,7 @@ status_is_old(gchar *buf)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test if a mail is marked as deleted
|
/* test if a mail is marked as deleted
|
||||||
| Evolution uses status with X-Evolution: 00000000-xxxx where xxxx status is
|
| Evolution uses status with X-Evolution: 00000000-xxxx where xxxx status is
|
||||||
| a bitfield in hexadecimal (see enum _CamelMessageFlags in evolution/camel source)
|
| a bitfield in hexadecimal (see enum _CamelMessageFlags in evolution/camel source)
|
||||||
| and most importantly CAMEL_MESSAGE_DELETED = 1<<1.
|
| and most importantly CAMEL_MESSAGE_DELETED = 1<<1.
|
||||||
|
@ -1751,7 +1763,7 @@ draw_mail_text_decal(gint new_mail_count, gint mail_count)
|
||||||
strcpy(tbuf, "-");
|
strcpy(tbuf, "-");
|
||||||
else
|
else
|
||||||
snprintf(tbuf, sizeof(tbuf), "%d", mail_count);
|
snprintf(tbuf, sizeof(tbuf), "%d", mail_count);
|
||||||
snprintf(buf, sizeof(buf), "%s/%s", nbuf, tbuf);
|
snprintf(buf, sizeof(buf), "%s/%s", nbuf, tbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
w = gkrellm_gdk_string_width(ts.font, buf);
|
w = gkrellm_gdk_string_width(ts.font, buf);
|
||||||
|
@ -2249,7 +2261,7 @@ update_mail(void)
|
||||||
if (GK.second_tick && (++second_count % local_check_timeout) == 0)
|
if (GK.second_tick && (++second_count % local_check_timeout) == 0)
|
||||||
local_check = TRUE;
|
local_check = TRUE;
|
||||||
fetch_check = fetch_check_is_local ? local_check : remote_check;
|
fetch_check = fetch_check_is_local ? local_check : remote_check;
|
||||||
|
|
||||||
if (remote_check || local_check)
|
if (remote_check || local_check)
|
||||||
mua_is_launched(); /* update pipe, avoid lingering zombie */
|
mua_is_launched(); /* update pipe, avoid lingering zombie */
|
||||||
|
|
||||||
|
@ -2283,7 +2295,7 @@ update_mail(void)
|
||||||
if (fetch_check)
|
if (fetch_check)
|
||||||
(*mbox->check_func)(mbox);
|
(*mbox->check_func)(mbox);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MBOX_CHECK_INLINE: /* Local mailbox or maildir check */
|
case MBOX_CHECK_INLINE: /* Local mailbox or maildir check */
|
||||||
if (local_check)
|
if (local_check)
|
||||||
{
|
{
|
||||||
|
@ -2525,7 +2537,7 @@ cb_panel_press(GtkWidget *widget, GdkEventButton *ev)
|
||||||
if (ev->button == 1 && ev->x >= d->x && ev->x < d->x + d->w)
|
if (ev->button == 1 && ev->x >= d->x && ev->x < d->x + d->w)
|
||||||
force_mail_check = TRUE;
|
force_mail_check = TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dup_account(MailAccount *dst, MailAccount *src)
|
dup_account(MailAccount *dst, MailAccount *src)
|
||||||
|
@ -3361,7 +3373,7 @@ cb_tree_selection_changed(GtkTreeSelection *selection, gpointer data)
|
||||||
active = (account->port == default_port) ? FALSE : TRUE;
|
active = (account->port == default_port) ? FALSE : TRUE;
|
||||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(port_button), active);
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(port_button), active);
|
||||||
sprintf(buf, "%d", account->port);
|
sprintf(buf, "%d", account->port);
|
||||||
gtk_entry_set_text(GTK_ENTRY(port_entry), buf);
|
gtk_entry_set_text(GTK_ENTRY(port_entry), buf);
|
||||||
}
|
}
|
||||||
else if (local_supported)
|
else if (local_supported)
|
||||||
{
|
{
|
||||||
|
@ -3950,7 +3962,7 @@ create_mail_tab(GtkWidget *tab_vbox)
|
||||||
gtk_box_pack_start(GTK_BOX(hbox), mbox_path_entry, TRUE, TRUE, 2);
|
gtk_box_pack_start(GTK_BOX(hbox), mbox_path_entry, TRUE, TRUE, 2);
|
||||||
gtk_entry_set_text(GTK_ENTRY(mbox_path_entry), "");
|
gtk_entry_set_text(GTK_ENTRY(mbox_path_entry), "");
|
||||||
g_signal_connect (G_OBJECT (mbox_path_entry), "activate",
|
g_signal_connect (G_OBJECT (mbox_path_entry), "activate",
|
||||||
G_CALLBACK(mailbox_enter_cb), NULL);
|
G_CALLBACK(mailbox_enter_cb), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remote mailbox account entry */
|
/* Remote mailbox account entry */
|
||||||
|
@ -4200,7 +4212,7 @@ create_mail_tab(GtkWidget *tab_vbox)
|
||||||
mh_seq_ignore, TRUE, TRUE, 0,
|
mh_seq_ignore, TRUE, TRUE, 0,
|
||||||
multi_toggle_button_cb, NULL,
|
multi_toggle_button_cb, NULL,
|
||||||
_("Ignore .mh_sequences when checking MH mail."));
|
_("Ignore .mh_sequences when checking MH mail."));
|
||||||
|
|
||||||
/* --Info tab */
|
/* --Info tab */
|
||||||
vbox = gkrellm_gtk_framed_notebook_page(tabs, _("Info"));
|
vbox = gkrellm_gtk_framed_notebook_page(tabs, _("Info"));
|
||||||
text = gkrellm_gtk_scrolled_text_view(vbox, NULL,
|
text = gkrellm_gtk_scrolled_text_view(vbox, NULL,
|
||||||
|
@ -4246,6 +4258,12 @@ static GkrellmMonitor monitor_mail =
|
||||||
GkrellmMonitor *
|
GkrellmMonitor *
|
||||||
gkrellm_init_mail_monitor(void)
|
gkrellm_init_mail_monitor(void)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_SSL
|
||||||
|
#ifndef HAVE_GNUTLS
|
||||||
|
int i, num_locks = CRYPTO_num_locks();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
monitor_mail.name = _(monitor_mail.name);
|
monitor_mail.name = _(monitor_mail.name);
|
||||||
enable_mail = TRUE;
|
enable_mail = TRUE;
|
||||||
show_tooltip = TRUE;
|
show_tooltip = TRUE;
|
||||||
|
@ -4266,6 +4284,15 @@ gkrellm_init_mail_monitor(void)
|
||||||
#ifdef HAVE_GNUTLS
|
#ifdef HAVE_GNUTLS
|
||||||
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
||||||
gnutls_global_init();
|
gnutls_global_init();
|
||||||
|
#else
|
||||||
|
#ifdef HAVE_SSL
|
||||||
|
SSL_load_error_strings();
|
||||||
|
SSL_library_init();
|
||||||
|
ssl_locks = g_new(GMutex *, num_locks);
|
||||||
|
for (i = 0; i < num_locks; i++)
|
||||||
|
ssl_locks[i] = g_mutex_new();
|
||||||
|
CRYPTO_set_locking_callback(ssl_locking_cb);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mail_fetch = g_new0(Mailbox, 1);
|
mail_fetch = g_new0(Mailbox, 1);
|
||||||
|
|
56
src/main.c
56
src/main.c
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -645,7 +645,9 @@ top_frame_button_press(GtkWidget *widget, GdkEventButton *ev, gpointer data)
|
||||||
}
|
}
|
||||||
gtk_window_present(GTK_WINDOW(top_window));
|
gtk_window_present(GTK_WINDOW(top_window));
|
||||||
|
|
||||||
if (_GK.client_mode && gkrellm_client_server_connect_state() == 0)
|
if ( _GK.client_mode
|
||||||
|
&& gkrellm_client_server_connect_state() == DISCONNECTED
|
||||||
|
)
|
||||||
gkrellm_client_mode_connect_thread();
|
gkrellm_client_mode_connect_thread();
|
||||||
|
|
||||||
if (!_GK.withdrawn) /* Move window unless in the slit */
|
if (!_GK.withdrawn) /* Move window unless in the slit */
|
||||||
|
@ -2047,8 +2049,12 @@ setup_signal_handler(void)
|
||||||
gint
|
gint
|
||||||
main(gint argc, gchar **argv)
|
main(gint argc, gchar **argv)
|
||||||
{
|
{
|
||||||
gint i;
|
gint i;
|
||||||
gchar *s;
|
gchar *s;
|
||||||
|
enum GkrellmConnectResult connect_result;
|
||||||
|
GtkWidget *dlg;
|
||||||
|
|
||||||
|
gkrellm_sys_main_init();
|
||||||
|
|
||||||
#ifdef ENABLE_NLS
|
#ifdef ENABLE_NLS
|
||||||
gtk_set_locale();
|
gtk_set_locale();
|
||||||
|
@ -2186,15 +2192,44 @@ main(gint argc, gchar **argv)
|
||||||
g_debug("--- GKrellM %d.%d.%d ---\n", GKRELLM_VERSION_MAJOR,
|
g_debug("--- GKrellM %d.%d.%d ---\n", GKRELLM_VERSION_MAJOR,
|
||||||
GKRELLM_VERSION_MINOR, GKRELLM_VERSION_REV);
|
GKRELLM_VERSION_MINOR, GKRELLM_VERSION_REV);
|
||||||
|
|
||||||
gkrellm_sys_main_init(); //FIXME: call this later or earlier?
|
|
||||||
|
|
||||||
_GK.w_display = gdk_screen_get_width(gdk_screen_get_default());
|
_GK.w_display = gdk_screen_get_width(gdk_screen_get_default());
|
||||||
_GK.h_display = gdk_screen_get_height(gdk_screen_get_default());
|
_GK.h_display = gdk_screen_get_height(gdk_screen_get_default());
|
||||||
|
|
||||||
if (_GK.server && !gkrellm_client_mode_connect())
|
if (_GK.server)
|
||||||
{
|
{
|
||||||
gkrellm_exit(0);
|
connect_result = gkrellm_client_mode_connect();
|
||||||
return 0;
|
while (connect_result == BAD_CONNECT)
|
||||||
|
{
|
||||||
|
gint result;
|
||||||
|
|
||||||
|
dlg = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
|
||||||
|
GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO,
|
||||||
|
"GKrellM cannot connect to server:\n"
|
||||||
|
"\t%s:%d\n\n"
|
||||||
|
"Do you want to retry?",
|
||||||
|
_GK.server, _GK.server_port);
|
||||||
|
result = gtk_dialog_run(GTK_DIALOG(dlg));
|
||||||
|
gtk_widget_destroy(dlg);
|
||||||
|
if (result == GTK_RESPONSE_YES)
|
||||||
|
connect_result = gkrellm_client_mode_connect();
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (connect_result == BAD_SETUP)
|
||||||
|
{
|
||||||
|
dlg = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
|
||||||
|
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
|
||||||
|
"GKrellM cannot get initial setup from server:\n"
|
||||||
|
"\t\t%s:%d\n",
|
||||||
|
_GK.server, _GK.server_port);
|
||||||
|
gtk_dialog_run(GTK_DIALOG(dlg));
|
||||||
|
gtk_widget_destroy(dlg);
|
||||||
|
}
|
||||||
|
if (connect_result != GOOD_CONNECT)
|
||||||
|
{
|
||||||
|
gkrellm_exit(0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check_gkrellm_directories();
|
check_gkrellm_directories();
|
||||||
|
@ -2272,11 +2307,8 @@ main(gint argc, gchar **argv)
|
||||||
|
|
||||||
gkrellm_start_timer(_GK.update_HZ);
|
gkrellm_start_timer(_GK.update_HZ);
|
||||||
setup_signal_handler();
|
setup_signal_handler();
|
||||||
|
|
||||||
/* Enter main event-loop */
|
|
||||||
gtk_main();
|
gtk_main();
|
||||||
|
|
||||||
/* Save settings, positions and inet-monitor history */
|
|
||||||
gkrellm_save_all();
|
gkrellm_save_all();
|
||||||
|
|
||||||
/* disconnect from gkrellm-server if we're a client */
|
/* disconnect from gkrellm-server if we're a client */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -1072,7 +1072,7 @@ save_plugins_placement_file(void)
|
||||||
GkrellmMonitor *builtin, *plugin;
|
GkrellmMonitor *builtin, *plugin;
|
||||||
GkrellmMonprivate *mp;
|
GkrellmMonprivate *mp;
|
||||||
gchar *path;
|
gchar *path;
|
||||||
|
|
||||||
if (!plugin_placement_modified || _GK.demo || _GK.no_config)
|
if (!plugin_placement_modified || _GK.demo || _GK.no_config)
|
||||||
return;
|
return;
|
||||||
path = gkrellm_make_config_file_name(gkrellm_homedir(),
|
path = gkrellm_make_config_file_name(gkrellm_homedir(),
|
||||||
|
@ -1134,7 +1134,7 @@ save_plugins_enable_file(void)
|
||||||
GList *list;
|
GList *list;
|
||||||
GkrellmMonitor *m;
|
GkrellmMonitor *m;
|
||||||
gchar *path, *s;
|
gchar *path, *s;
|
||||||
|
|
||||||
if (!plugin_enable_list_modified || _GK.demo)
|
if (!plugin_enable_list_modified || _GK.demo)
|
||||||
return;
|
return;
|
||||||
path = gkrellm_make_config_file_name(gkrellm_homedir(),
|
path = gkrellm_make_config_file_name(gkrellm_homedir(),
|
||||||
|
@ -1177,7 +1177,7 @@ scan_for_plugins(gchar *path)
|
||||||
GkrellmMonitor *m = NULL;
|
GkrellmMonitor *m = NULL;
|
||||||
gchar *s;
|
gchar *s;
|
||||||
gboolean exists;
|
gboolean exists;
|
||||||
|
|
||||||
if (!path || !*path || (dir = g_dir_open(path, 0, NULL)) == NULL)
|
if (!path || !*path || (dir = g_dir_open(path, 0, NULL)) == NULL)
|
||||||
return;
|
return;
|
||||||
while ((name = (gchar *) g_dir_read_name(dir)) != NULL)
|
while ((name = (gchar *) g_dir_read_name(dir)) != NULL)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -191,7 +191,8 @@ gkrellm_sensors_add_sensor(gint type, gchar *sensor_path, gchar *id_name,
|
||||||
/* ======================================================================== */
|
/* ======================================================================== */
|
||||||
static gboolean use_threads,
|
static gboolean use_threads,
|
||||||
thread_data_valid,
|
thread_data_valid,
|
||||||
units_fahrenheit;
|
units_fahrenheit,
|
||||||
|
show_units = TRUE;
|
||||||
|
|
||||||
static gboolean thread_busy;
|
static gboolean thread_busy;
|
||||||
|
|
||||||
|
@ -375,7 +376,7 @@ gkrellm_sensor_draw_temperature_decal(GkrellmPanel *p, GkrellmDecal *d,
|
||||||
w = gkrellm_gdk_string_width(d->text_style.font, buf)
|
w = gkrellm_gdk_string_width(d->text_style.font, buf)
|
||||||
+ d->text_style.effect;
|
+ d->text_style.effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->x_off = d->w - w;
|
d->x_off = d->w - w;
|
||||||
if (d->x_off < 0)
|
if (d->x_off < 0)
|
||||||
d->x_off = 0;
|
d->x_off = 0;
|
||||||
|
@ -522,7 +523,12 @@ sensor_read_temperature(Sensor *sensor, gfloat *temp, gchar *units)
|
||||||
if (temp)
|
if (temp)
|
||||||
*temp = t;
|
*temp = t;
|
||||||
if (units)
|
if (units)
|
||||||
*units = units_fahrenheit ? 'F':'C';
|
{
|
||||||
|
if (show_units)
|
||||||
|
*units = units_fahrenheit ? 'F':'C';
|
||||||
|
else
|
||||||
|
*units = '\0';
|
||||||
|
}
|
||||||
if ((_GK.debug_level & DEBUG_SENSORS) && sensor)
|
if ((_GK.debug_level & DEBUG_SENSORS) && sensor)
|
||||||
printf("sensor_temp: %s %s t=%.2f\n",
|
printf("sensor_temp: %s %s t=%.2f\n",
|
||||||
sensor->name_locale, sensor->path, sensor->value);
|
sensor->name_locale, sensor->path, sensor->value);
|
||||||
|
@ -778,7 +784,7 @@ gkrellm_sensors_interface_remove(gint _interface)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (removed_one);
|
while (removed_one);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1036,7 +1042,7 @@ layout_volt_decals(GkrellmPanel *p, GkrellmStyle *style)
|
||||||
cols = n;;
|
cols = n;;
|
||||||
volt_mon_width = w / cols; /* spread them out */
|
volt_mon_width = w / cols; /* spread them out */
|
||||||
x = (w - cols * volt_mon_width) / 2 + m->left;
|
x = (w - cols * volt_mon_width) / 2 + m->left;
|
||||||
|
|
||||||
gkrellm_get_top_bottom_margins(style, &y, NULL);
|
gkrellm_get_top_bottom_margins(style, &y, NULL);
|
||||||
c = 0;
|
c = 0;
|
||||||
for (list = volt_list; list; list = list->next)
|
for (list = volt_list; list; list = list->next)
|
||||||
|
@ -1362,7 +1368,10 @@ make_temperature_panel(GtkWidget *vbox, gint first_create)
|
||||||
return;
|
return;
|
||||||
style = gkrellm_meter_style(style_id);
|
style = gkrellm_meter_style(style_id);
|
||||||
m = gkrellm_get_style_margins(style);
|
m = gkrellm_get_style_margins(style);
|
||||||
format = units_fahrenheit ? "188.8F" : "88.8C";
|
if (show_units)
|
||||||
|
format = units_fahrenheit ? "188.8F" : "88.8C";
|
||||||
|
else
|
||||||
|
format = units_fahrenheit ? "188.8" : "88.8";
|
||||||
assign_textstyles(temperature_list, &ts_name, &ts_sensor, format);
|
assign_textstyles(temperature_list, &ts_name, &ts_sensor, format);
|
||||||
gkrellm_get_top_bottom_margins(style, &y, NULL);
|
gkrellm_get_top_bottom_margins(style, &y, NULL);
|
||||||
y += bezel_style->border.top;
|
y += bezel_style->border.top;
|
||||||
|
@ -1473,7 +1482,7 @@ make_volt_panel(GtkWidget *vbox, gint first_create)
|
||||||
style = gkrellm_meter_style(style_id);
|
style = gkrellm_meter_style(style_id);
|
||||||
make_volt_decals(pVolt, style);
|
make_volt_decals(pVolt, style);
|
||||||
layout_volt_decals(pVolt, style);
|
layout_volt_decals(pVolt, style);
|
||||||
|
|
||||||
gkrellm_panel_configure(pVolt, NULL, style);
|
gkrellm_panel_configure(pVolt, NULL, style);
|
||||||
|
|
||||||
/* Make the bottom margin reference against the bottom volt decals
|
/* Make the bottom margin reference against the bottom volt decals
|
||||||
|
@ -1587,7 +1596,7 @@ create_sensors(GtkWidget *vbox, gint first_create)
|
||||||
| THEME_DIR/sensors/bg_volt.png
|
| THEME_DIR/sensors/bg_volt.png
|
||||||
| and for a border for it from the gkrellmrc in the format:
|
| and for a border for it from the gkrellmrc in the format:
|
||||||
| set_piximage_border sensors_bg_volt l,r,t,b
|
| set_piximage_border sensors_bg_volt l,r,t,b
|
||||||
| There is no default for bg_volt image, ie it may end up being NULL.
|
| There is no default for bg_volt image, ie it may end up being NULL.
|
||||||
*/
|
*/
|
||||||
xpm = gkrellm_using_default_theme() ? bg_volt_xpm : NULL;
|
xpm = gkrellm_using_default_theme() ? bg_volt_xpm : NULL;
|
||||||
if (bezel_piximage)
|
if (bezel_piximage)
|
||||||
|
@ -1773,6 +1782,8 @@ save_sensors_config(FILE *f_not_used)
|
||||||
|
|
||||||
fprintf(f, "%s units_fahrenheit %d\n", SENSOR_CONFIG_KEYWORD,
|
fprintf(f, "%s units_fahrenheit %d\n", SENSOR_CONFIG_KEYWORD,
|
||||||
units_fahrenheit);
|
units_fahrenheit);
|
||||||
|
fprintf(f, "%s show_units %d\n", SENSOR_CONFIG_KEYWORD,
|
||||||
|
show_units);
|
||||||
fprintf(f, "%s volt_display_mode %d\n", SENSOR_CONFIG_KEYWORD,
|
fprintf(f, "%s volt_display_mode %d\n", SENSOR_CONFIG_KEYWORD,
|
||||||
display_mode);
|
display_mode);
|
||||||
/* _GK.mbmon_port is handled in config.c so that the port can be
|
/* _GK.mbmon_port is handled in config.c so that the port can be
|
||||||
|
@ -1807,6 +1818,8 @@ load_sensors_config(gchar *arg)
|
||||||
sscanf(item, "%d", &sensor_config_sysdep_private);
|
sscanf(item, "%d", &sensor_config_sysdep_private);
|
||||||
else if (!strcmp(config, "units_fahrenheit"))
|
else if (!strcmp(config, "units_fahrenheit"))
|
||||||
sscanf(item, "%d", &units_fahrenheit);
|
sscanf(item, "%d", &units_fahrenheit);
|
||||||
|
else if (!strcmp(config, "show_units"))
|
||||||
|
sscanf(item, "%d", &show_units);
|
||||||
else if (!strcmp(config, "volt_display_mode"))
|
else if (!strcmp(config, "volt_display_mode"))
|
||||||
sscanf(item, "%d", &display_mode);
|
sscanf(item, "%d", &display_mode);
|
||||||
else if (!strcmp(config, "sensor_float_factor"))
|
else if (!strcmp(config, "sensor_float_factor"))
|
||||||
|
@ -2526,7 +2539,7 @@ enable_cb(GtkCellRendererText *cell, gchar *path_string, gpointer data)
|
||||||
-1);
|
-1);
|
||||||
s->enabled = !enabled;
|
s->enabled = !enabled;
|
||||||
gtk_tree_store_set(GTK_TREE_STORE(model), &iter,
|
gtk_tree_store_set(GTK_TREE_STORE(model), &iter,
|
||||||
ENABLE_COLUMN, s->enabled,
|
ENABLE_COLUMN, s->enabled,
|
||||||
-1);
|
-1);
|
||||||
change_row_reference(model, path);
|
change_row_reference(model, path);
|
||||||
gtk_tree_path_free(path);
|
gtk_tree_path_free(path);
|
||||||
|
@ -2588,6 +2601,21 @@ cb_temperature_units(GtkWidget *button, gpointer data)
|
||||||
gkrellm_proc_draw_sensors(NULL);
|
gkrellm_proc_draw_sensors(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
cb_show_units(GtkWidget *button, gpointer data)
|
||||||
|
{
|
||||||
|
gint show;
|
||||||
|
|
||||||
|
show = GTK_TOGGLE_BUTTON(button)->active;
|
||||||
|
if (show == show_units)
|
||||||
|
return;
|
||||||
|
show_units = show;
|
||||||
|
|
||||||
|
gkrellm_sensors_rebuild(DO_TEMP, FALSE, FALSE);
|
||||||
|
gkrellm_cpu_draw_sensors(NULL);
|
||||||
|
gkrellm_proc_draw_sensors(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cb_voltages_display(GtkWidget *entry, gpointer data)
|
cb_voltages_display(GtkWidget *entry, gpointer data)
|
||||||
{
|
{
|
||||||
|
@ -2655,7 +2683,7 @@ static gchar *sensor_info_text0[] =
|
||||||
"\n",
|
"\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
static gchar *sensor_info_text1[] =
|
static gchar *sensor_info_text1[] =
|
||||||
{
|
{
|
||||||
N_("<h>Setup\n"),
|
N_("<h>Setup\n"),
|
||||||
N_("Enter data scaling factors and offsets for the sensors if the default\n"
|
N_("Enter data scaling factors and offsets for the sensors if the default\n"
|
||||||
|
@ -2812,6 +2840,10 @@ create_sensors_tab(GtkWidget *tab_vbox)
|
||||||
units_fahrenheit, FALSE, FALSE, 0,
|
units_fahrenheit, FALSE, FALSE, 0,
|
||||||
cb_temperature_units, NULL,
|
cb_temperature_units, NULL,
|
||||||
_("Display fahrenheit"));
|
_("Display fahrenheit"));
|
||||||
|
gkrellm_gtk_check_button_connected(box, &button,
|
||||||
|
show_units, FALSE, FALSE, 0,
|
||||||
|
cb_show_units, NULL,
|
||||||
|
_("Show units"));
|
||||||
if (!sensor_list)
|
if (!sensor_list)
|
||||||
gtk_widget_set_sensitive(button, FALSE);
|
gtk_widget_set_sensitive(button, FALSE);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -33,14 +33,20 @@
|
||||||
| as that of the covered work.
|
| as that of the covered work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/sysctl.h>
|
||||||
|
#include <osreldate.h>
|
||||||
|
|
||||||
|
#if __FreeBSD_version < 500000
|
||||||
#include <kvm.h>
|
#include <kvm.h>
|
||||||
|
|
||||||
kvm_t *kvmd = NULL;
|
kvm_t *kvmd = NULL;
|
||||||
char errbuf[_POSIX2_LINE_MAX];
|
char errbuf[_POSIX2_LINE_MAX];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// extern gboolean force_meminfo_update(void);
|
// extern gboolean force_meminfo_update(void);
|
||||||
#if defined(__i386__)
|
#if defined(__i386__) || defined(__amd64__)
|
||||||
static void scan_for_sensors();
|
static void scan_for_sensors();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -51,13 +57,15 @@ gkrellm_sys_main_init(void)
|
||||||
/* We just ignore error, here. Even if GKrellM doesn't have
|
/* We just ignore error, here. Even if GKrellM doesn't have
|
||||||
| kmem privilege, it runs with available information.
|
| kmem privilege, it runs with available information.
|
||||||
*/
|
*/
|
||||||
|
#if __FreeBSD_version < 500000
|
||||||
kvmd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
|
kvmd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
|
||||||
|
#endif
|
||||||
if (setgid(getgid()) != 0)
|
if (setgid(getgid()) != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Can't drop setgid privileges.");
|
fprintf(stderr, "Can't drop setgid privileges.");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#if defined(__i386__)
|
#if defined(__i386__) || defined(__amd64__)
|
||||||
scan_for_sensors();
|
scan_for_sensors();
|
||||||
#endif
|
#endif
|
||||||
if (setuid(getuid()) != 0)
|
if (setuid(getuid()) != 0)
|
||||||
|
@ -72,9 +80,6 @@ gkrellm_sys_main_cleanup(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <sys/param.h>
|
|
||||||
#include <sys/sysctl.h>
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
gk_sysctlnametomib(const char *name, int *mibp, size_t *lenp)
|
gk_sysctlnametomib(const char *name, int *mibp, size_t *lenp)
|
||||||
{
|
{
|
||||||
|
@ -90,38 +95,43 @@ gk_sysctlnametomib(const char *name, int *mibp, size_t *lenp)
|
||||||
/* ===================================================================== */
|
/* ===================================================================== */
|
||||||
/* CPU monitor interface */
|
/* CPU monitor interface */
|
||||||
|
|
||||||
#include <osreldate.h>
|
|
||||||
#if __FreeBSD_version >= 500101
|
#if __FreeBSD_version >= 500101
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/dkstat.h>
|
#include <sys/dkstat.h>
|
||||||
#endif
|
#endif
|
||||||
#include <kvm.h>
|
|
||||||
|
|
||||||
|
|
||||||
extern kvm_t *kvmd;
|
|
||||||
|
|
||||||
static int oid_cp_time[CTL_MAXNAME + 2];
|
static int oid_cp_time[CTL_MAXNAME + 2];
|
||||||
|
static int oid_cp_times[CTL_MAXNAME + 2];
|
||||||
static size_t oid_cp_time_len = sizeof(oid_cp_time);
|
static size_t oid_cp_time_len = sizeof(oid_cp_time);
|
||||||
|
static size_t oid_cp_times_len = sizeof(oid_cp_times);
|
||||||
static gint have_cp_time;
|
static gint have_cp_time;
|
||||||
|
static gint maxid;
|
||||||
|
static gint ncpus;
|
||||||
|
static u_long cpumask;
|
||||||
|
static long *cp_times;
|
||||||
|
|
||||||
void
|
void
|
||||||
gkrellm_sys_cpu_read_data(void)
|
gkrellm_sys_cpu_read_data(void)
|
||||||
{
|
{
|
||||||
long cp_time[CPUSTATES];
|
long cp_time[CPUSTATES], *cp_timep;
|
||||||
int len = sizeof(cp_time);
|
size_t len;
|
||||||
|
#if __FreeBSD_version < 500000
|
||||||
static struct nlist nl[] = {
|
static struct nlist nl[] = {
|
||||||
#define N_CP_TIME 0
|
#define N_CP_TIME 0
|
||||||
{ "_cp_time" },
|
{ "_cp_time" },
|
||||||
{ "" }
|
{ "" }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
if (have_cp_time)
|
if (have_cp_time)
|
||||||
{
|
{
|
||||||
if (sysctl(oid_cp_time, oid_cp_time_len,
|
len = sizeof(cp_time);
|
||||||
cp_time, &len, 0, 0) < 0)
|
if (sysctl(oid_cp_time, oid_cp_time_len, cp_time, &len,
|
||||||
|
NULL, 0) < 0)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#if __FreeBSD_version < 500000
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (kvmd == NULL)
|
if (kvmd == NULL)
|
||||||
|
@ -133,22 +143,92 @@ gkrellm_sys_cpu_read_data(void)
|
||||||
sizeof(cp_time)) != sizeof(cp_time))
|
sizeof(cp_time)) != sizeof(cp_time))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Currently, SMP is not supported */
|
if (ncpus > 1)
|
||||||
gkrellm_cpu_assign_data(0, cp_time[CP_USER], cp_time[CP_NICE],
|
{
|
||||||
cp_time[CP_SYS], cp_time[CP_IDLE]);
|
gint i, j;
|
||||||
|
|
||||||
|
gkrellm_cpu_assign_composite_data(cp_time[CP_USER],
|
||||||
|
cp_time[CP_NICE],
|
||||||
|
cp_time[CP_SYS],
|
||||||
|
cp_time[CP_IDLE]);
|
||||||
|
|
||||||
|
len = (maxid + 1) * sizeof(long) * CPUSTATES;
|
||||||
|
if (sysctl(oid_cp_times, oid_cp_times_len, cp_times, &len,
|
||||||
|
NULL, 0) < 0)
|
||||||
|
return;
|
||||||
|
for (i = j = 0; i <= maxid; ++i)
|
||||||
|
{
|
||||||
|
if ((cpumask & (1ul << i)) == 0)
|
||||||
|
continue;
|
||||||
|
cp_timep = &cp_times[i * CPUSTATES];
|
||||||
|
gkrellm_cpu_assign_data(j, cp_timep[CP_USER],
|
||||||
|
cp_timep[CP_NICE],
|
||||||
|
cp_timep[CP_SYS],
|
||||||
|
cp_timep[CP_IDLE]);
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
gkrellm_cpu_assign_data(0, cp_time[CP_USER], cp_time[CP_NICE],
|
||||||
|
cp_time[CP_SYS], cp_time[CP_IDLE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gkrellm_sys_cpu_init(void)
|
gkrellm_sys_cpu_init(void)
|
||||||
{
|
{
|
||||||
static char *name = "kern.cp_time";
|
gint have_cp_times = FALSE;
|
||||||
|
gint maxcpus;
|
||||||
|
size_t len;
|
||||||
|
long *p;
|
||||||
|
|
||||||
gkrellm_cpu_set_number_of_cpus(1);
|
if (gk_sysctlnametomib("kern.cp_time", oid_cp_time,
|
||||||
|
&oid_cp_time_len) >= 0)
|
||||||
|
have_cp_time = TRUE;
|
||||||
|
|
||||||
if (gk_sysctlnametomib(name, oid_cp_time, &oid_cp_time_len) < 0)
|
len = sizeof(maxcpus);
|
||||||
return TRUE;
|
if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &len, NULL, 0) >= 0)
|
||||||
++have_cp_time;
|
{
|
||||||
|
gint empty, i, j;
|
||||||
|
|
||||||
|
if (gk_sysctlnametomib("kern.cp_times", oid_cp_times,
|
||||||
|
&oid_cp_times_len) < 0)
|
||||||
|
goto pcpu_probe_done;
|
||||||
|
len = maxcpus * sizeof(long) * CPUSTATES;
|
||||||
|
if ((cp_times = malloc(len)) == NULL)
|
||||||
|
goto pcpu_probe_done;
|
||||||
|
if (sysctl(oid_cp_times, oid_cp_times_len, cp_times, &len,
|
||||||
|
NULL, 0) < 0)
|
||||||
|
{
|
||||||
|
free(cp_times);
|
||||||
|
cp_times = NULL;
|
||||||
|
goto pcpu_probe_done;
|
||||||
|
}
|
||||||
|
maxid = (len / CPUSTATES / sizeof(long)) - 1;
|
||||||
|
cpumask = 0;
|
||||||
|
ncpus = 0;
|
||||||
|
for (i = 0; i <= maxid; ++i)
|
||||||
|
{
|
||||||
|
empty = 1;
|
||||||
|
for (j = 0; empty && j < CPUSTATES; ++j)
|
||||||
|
if (cp_times[i * CPUSTATES + j] != 0)
|
||||||
|
empty = 0;
|
||||||
|
if (!empty)
|
||||||
|
{
|
||||||
|
cpumask |= (1ul << i);
|
||||||
|
++ncpus;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((p = realloc(cp_times, len)) != NULL)
|
||||||
|
cp_times = p;
|
||||||
|
have_cp_times = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
pcpu_probe_done:
|
||||||
|
if (!have_cp_times)
|
||||||
|
ncpus = 1;
|
||||||
|
gkrellm_cpu_set_number_of_cpus(ncpus);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,8 +236,6 @@ gkrellm_sys_cpu_init(void)
|
||||||
/* ===================================================================== */
|
/* ===================================================================== */
|
||||||
/* Proc monitor interface */
|
/* Proc monitor interface */
|
||||||
|
|
||||||
#include <osreldate.h>
|
|
||||||
#include <sys/sysctl.h>
|
|
||||||
#if __FreeBSD_version >= 400000
|
#if __FreeBSD_version >= 400000
|
||||||
#include <sys/user.h>
|
#include <sys/user.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -175,13 +253,10 @@ gkrellm_sys_cpu_init(void)
|
||||||
#undef KERNEL
|
#undef KERNEL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <kvm.h>
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <paths.h>
|
#include <paths.h>
|
||||||
#include <utmp.h>
|
#include <utmp.h>
|
||||||
|
|
||||||
extern kvm_t *kvmd;
|
|
||||||
|
|
||||||
static int oid_v_forks[CTL_MAXNAME + 2];
|
static int oid_v_forks[CTL_MAXNAME + 2];
|
||||||
static int oid_v_vforks[CTL_MAXNAME + 2];
|
static int oid_v_vforks[CTL_MAXNAME + 2];
|
||||||
static int oid_v_rforks[CTL_MAXNAME + 2];
|
static int oid_v_rforks[CTL_MAXNAME + 2];
|
||||||
|
@ -215,17 +290,19 @@ gkrellm_sys_proc_read_data(void)
|
||||||
static int oid_proc[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL };
|
static int oid_proc[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL };
|
||||||
#endif
|
#endif
|
||||||
double avenrun;
|
double avenrun;
|
||||||
static u_int n_processes, n_forks = 0, curpid = -1;
|
static u_int n_processes, n_forks = 0;
|
||||||
u_int n_vforks, n_rforks;
|
u_int n_vforks, n_rforks;
|
||||||
gint r_forks, r_vforks, r_rforks;
|
gint r_forks, r_vforks, r_rforks;
|
||||||
gint len;
|
size_t len;
|
||||||
|
#if __FreeBSD_version < 500000
|
||||||
|
static u_int curpid = -1;
|
||||||
gint nextpid, nforked;
|
gint nextpid, nforked;
|
||||||
static struct nlist nl[] = {
|
static struct nlist nl[] = {
|
||||||
#define N_NEXTPID 0
|
#define N_NEXTPID 0
|
||||||
{ "_nextpid" },
|
{ "_nextpid" },
|
||||||
{ "" }
|
{ "" }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
if (getloadavg(&avenrun, 1) <= 0)
|
if (getloadavg(&avenrun, 1) <= 0)
|
||||||
avenrun = 0;
|
avenrun = 0;
|
||||||
|
@ -246,6 +323,7 @@ gkrellm_sys_proc_read_data(void)
|
||||||
if (r_forks >= 0 && r_vforks >= 0 && r_rforks >= 0)
|
if (r_forks >= 0 && r_vforks >= 0 && r_rforks >= 0)
|
||||||
n_forks = n_forks + n_vforks + n_rforks;
|
n_forks = n_forks + n_vforks + n_rforks;
|
||||||
}
|
}
|
||||||
|
#if __FreeBSD_version < 500000
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* workaround: Can I get total number of processes? */
|
/* workaround: Can I get total number of processes? */
|
||||||
|
@ -268,6 +346,7 @@ gkrellm_sys_proc_read_data(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __FreeBSD_version >= 400000
|
#if __FreeBSD_version >= 400000
|
||||||
if (sysctl(oid_proc, 3, NULL, &len, NULL, 0) >= 0)
|
if (sysctl(oid_proc, 3, NULL, &len, NULL, 0) >= 0)
|
||||||
|
@ -318,10 +397,6 @@ gkrellm_sys_proc_read_users(void)
|
||||||
#if __FreeBSD_version >= 300000
|
#if __FreeBSD_version >= 300000
|
||||||
#include <devstat.h>
|
#include <devstat.h>
|
||||||
static struct statinfo statinfo_cur;
|
static struct statinfo statinfo_cur;
|
||||||
#else
|
|
||||||
#include <kvm.h>
|
|
||||||
|
|
||||||
extern kvm_t *kvmd;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gchar *
|
gchar *
|
||||||
|
@ -479,11 +554,7 @@ gkrellm_sys_disk_init(void)
|
||||||
#include <netinet6/tcp6_var.h>
|
#include <netinet6/tcp6_var.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <kvm.h>
|
|
||||||
#include <nlist.h>
|
#include <nlist.h>
|
||||||
|
|
||||||
extern kvm_t *kvmd;
|
|
||||||
extern char errbuf[];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -582,7 +653,7 @@ gkrellm_sys_inet_read_tcp_data(void)
|
||||||
gint tcp_status;
|
gint tcp_status;
|
||||||
struct xinpgen *xig, *oxig;
|
struct xinpgen *xig, *oxig;
|
||||||
gchar *buf;
|
gchar *buf;
|
||||||
gint len = 0;
|
size_t len = 0;
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
|
@ -655,17 +726,14 @@ gkrellm_sys_inet_init(void)
|
||||||
/* ===================================================================== */
|
/* ===================================================================== */
|
||||||
/* Memory/Swap monitor interface */
|
/* Memory/Swap monitor interface */
|
||||||
|
|
||||||
#include <osreldate.h>
|
|
||||||
#include <kvm.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <sys/conf.h>
|
#include <sys/conf.h>
|
||||||
#if __FreeBSD_version < 400000
|
#if __FreeBSD_version < 400000
|
||||||
#include <sys/rlist.h>
|
#include <sys/rlist.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/vmmeter.h>
|
#include <sys/vmmeter.h>
|
||||||
#include <sys/sysctl.h>
|
|
||||||
#include <vm/vm_param.h>
|
#include <vm/vm_param.h>
|
||||||
|
|
||||||
|
#if __FreeBSD_version < 410000
|
||||||
static struct nlist nl_mem[] = {
|
static struct nlist nl_mem[] = {
|
||||||
#define N_CNT 0
|
#define N_CNT 0
|
||||||
{ "_cnt" },
|
{ "_cnt" },
|
||||||
|
@ -687,17 +755,20 @@ static struct nlist nl_mem[] = {
|
||||||
#endif
|
#endif
|
||||||
{ "" }
|
{ "" }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
extern kvm_t *kvmd;
|
|
||||||
extern char errbuf[];
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
swapmode(guint64 *retavail, guint64 *retfree)
|
swapmode(unsigned long long *retavail, unsigned long long *retfree)
|
||||||
{
|
{
|
||||||
guint64 used, avail;
|
guint64 used, avail;
|
||||||
#if __FreeBSD_version >= 400000
|
#if __FreeBSD_version >= 400000
|
||||||
static int psize = -1;
|
static int psize = -1;
|
||||||
struct kvm_swap kvmswap;
|
struct kvm_swap kvmswap;
|
||||||
|
#if __FreeBSD_version >= 500000
|
||||||
|
struct xswdev xsw;
|
||||||
|
size_t mibsize, size;
|
||||||
|
int mib[16], n;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
char *header;
|
char *header;
|
||||||
int hlen, nswap, nswdev, dmmax;
|
int hlen, nswap, nswdev, dmmax;
|
||||||
|
@ -734,21 +805,37 @@ swapmode(guint64 *retavail, guint64 *retfree)
|
||||||
}
|
}
|
||||||
warning--; /* decrease counter, see end of function */
|
warning--; /* decrease counter, see end of function */
|
||||||
|
|
||||||
|
#if __FreeBSD_version >= 400000
|
||||||
|
#if __FreeBSD_version >= 500000
|
||||||
|
mibsize = sizeof mib / sizeof mib[0];
|
||||||
|
if (gk_sysctlnametomib("vm.swap_info", mib, &mibsize) == -1)
|
||||||
|
return(0);
|
||||||
|
kvmswap.ksw_total = 0;
|
||||||
|
kvmswap.ksw_used = 0;
|
||||||
|
for (n = 0; ; ++n)
|
||||||
|
{
|
||||||
|
mib[mibsize] = n;
|
||||||
|
size = sizeof xsw;
|
||||||
|
if (sysctl(mib, mibsize + 1, &xsw, &size, NULL, 0) == -1)
|
||||||
|
break;
|
||||||
|
kvmswap.ksw_total += xsw.xsw_nblks;
|
||||||
|
kvmswap.ksw_used += xsw.xsw_used;
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (kvmd == NULL)
|
if (kvmd == NULL)
|
||||||
return(0);
|
return(0);
|
||||||
#if __FreeBSD_version >= 400000
|
|
||||||
if (kvm_getswapinfo(kvmd, &kvmswap, 1, 0) < 0)
|
if (kvm_getswapinfo(kvmd, &kvmswap, 1, 0) < 0)
|
||||||
{
|
|
||||||
fprintf(stderr, "kvm_getswapinfo failed\n");
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
|
||||||
|
|
||||||
|
#endif
|
||||||
if (psize < 0)
|
if (psize < 0)
|
||||||
psize = getpagesize();
|
psize = getpagesize();
|
||||||
*retavail = avail = (quad_t)kvmswap.ksw_total * psize;
|
*retavail = avail = (quad_t)kvmswap.ksw_total * psize;
|
||||||
used = (quad_t)kvmswap.ksw_used * psize;
|
used = (quad_t)kvmswap.ksw_used * psize;
|
||||||
*retfree = avail - used;
|
*retfree = avail - used;
|
||||||
#else
|
#else
|
||||||
|
if (kvmd == NULL)
|
||||||
|
return(0);
|
||||||
if (kvm_read(kvmd, nl_mem[VM_NSWAP].n_value,
|
if (kvm_read(kvmd, nl_mem[VM_NSWAP].n_value,
|
||||||
&nswap, sizeof(nswap)) != sizeof(nswap))
|
&nswap, sizeof(nswap)) != sizeof(nswap))
|
||||||
return(0);
|
return(0);
|
||||||
|
@ -898,7 +985,7 @@ get_bufspace(guint64 *bufspacep)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sysctl(oid_bufspace, oid_bufspace_len,
|
if (sysctl(oid_bufspace, oid_bufspace_len,
|
||||||
&bufspace, &bufspace_len, 0, 0) < 0)
|
&bufspace, &bufspace_len, NULL, 0) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
*bufspacep = bufspace;
|
*bufspacep = bufspace;
|
||||||
|
@ -942,9 +1029,9 @@ static struct mibtab mibs[] = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static guint64 swapin,
|
static guint64 swapin,
|
||||||
swapout,
|
swapout;
|
||||||
swap_total,
|
static unsigned long long swap_total,
|
||||||
swap_used;
|
swap_used;
|
||||||
|
|
||||||
void
|
void
|
||||||
gkrellm_sys_mem_read_data(void)
|
gkrellm_sys_mem_read_data(void)
|
||||||
|
@ -954,15 +1041,14 @@ gkrellm_sys_mem_read_data(void)
|
||||||
static gint swappgsin = -1;
|
static gint swappgsin = -1;
|
||||||
static gint swappgsout = -1;
|
static gint swappgsout = -1;
|
||||||
gint dpagein, dpageout;
|
gint dpagein, dpageout;
|
||||||
struct vmmeter sum;
|
|
||||||
guint64 total, used, x_used, free, shared, buffers, cached;
|
guint64 total, used, x_used, free, shared, buffers, cached;
|
||||||
struct vmtotal vmt;
|
struct vmtotal vmt;
|
||||||
size_t length_vmt = sizeof(vmt);
|
size_t length_vmt = sizeof(vmt);
|
||||||
static int oid_vmt[] = { CTL_VM, VM_TOTAL };
|
static int oid_vmt[] = { CTL_VM, VM_TOTAL };
|
||||||
#if __FreeBSD_version >= 410000
|
#if __FreeBSD_version >= 410000
|
||||||
gint i;
|
gint i;
|
||||||
FILE *f;
|
#else
|
||||||
gchar buf[160];
|
struct vmmeter sum;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -981,60 +1067,49 @@ gkrellm_sys_mem_read_data(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
shared = 0;
|
shared = 0;
|
||||||
if (kvmd == NULL)
|
|
||||||
{
|
|
||||||
#if __FreeBSD_version >= 410000
|
#if __FreeBSD_version >= 410000
|
||||||
if (!first_time_done)
|
if (!first_time_done)
|
||||||
{
|
{
|
||||||
for (i = 0; mibs[i].name; ++i)
|
|
||||||
{
|
|
||||||
mibs[i].oid_len = sizeof(mibs[i].oid);
|
|
||||||
if (gk_sysctlnametomib(mibs[i].name,
|
|
||||||
mibs[i].oid,
|
|
||||||
&mibs[i].oid_len) < 0)
|
|
||||||
return;
|
|
||||||
mibs[i].value_len = sizeof(mibs[i].value);
|
|
||||||
}
|
|
||||||
++first_time_done;
|
|
||||||
}
|
|
||||||
for (i = 0; mibs[i].name; ++i)
|
for (i = 0; mibs[i].name; ++i)
|
||||||
if (sysctl(mibs[i].oid, mibs[i].oid_len,
|
|
||||||
&mibs[i].value,
|
|
||||||
&mibs[i].value_len, 0, 0) < 0)
|
|
||||||
return;
|
|
||||||
total = (mibs[MIB_V_PAGE_COUNT].value -
|
|
||||||
mibs[MIB_V_WIRE_COUNT].value) << pshift;
|
|
||||||
x_used = (mibs[MIB_V_ACTIVE_COUNT].value +
|
|
||||||
mibs[MIB_V_INACTIVE_COUNT].value) << pshift;
|
|
||||||
free = mibs[MIB_V_FREE_COUNT].value << pshift;
|
|
||||||
if (sysctl(oid_vmt, 2, &vmt, &length_vmt, NULL, 0) == 0)
|
|
||||||
shared = vmt.t_rmshr << pshift;
|
|
||||||
get_bufspace(&buffers);
|
|
||||||
cached = mibs[MIB_V_CACHE_COUNT].value << pshift;
|
|
||||||
used = x_used - buffers - cached;
|
|
||||||
gkrellm_mem_assign_data(total, used, free, shared, buffers, cached);
|
|
||||||
|
|
||||||
swapin = mibs[MIB_V_SWAPPGSIN].value;
|
|
||||||
swapout = mibs[MIB_V_SWAPPGSOUT].value;
|
|
||||||
|
|
||||||
/* Try linprocfs for swap info */
|
|
||||||
if ((f = fopen(PROC_MEMINFO_FILE, "r")) == NULL)
|
|
||||||
return;
|
|
||||||
/* total: used: free: shared: buffers: cached: */
|
|
||||||
while ((fgets(buf, sizeof(buf), f)) != NULL)
|
|
||||||
{
|
{
|
||||||
if (strncmp(buf, "Swap:", 5) == 0)
|
mibs[i].oid_len = sizeof(mibs[i].oid);
|
||||||
{
|
if (gk_sysctlnametomib(mibs[i].name, mibs[i].oid,
|
||||||
sscanf(buf, "Swap: %llu %llu",
|
&mibs[i].oid_len) < 0)
|
||||||
&swap_total, &swap_used);
|
return;
|
||||||
break;
|
mibs[i].value_len = sizeof(mibs[i].value);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fclose(f);
|
|
||||||
#endif
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
for (i = 0; mibs[i].name; ++i)
|
||||||
|
if (sysctl(mibs[i].oid, mibs[i].oid_len, &mibs[i].value,
|
||||||
|
&mibs[i].value_len, NULL, 0) < 0)
|
||||||
|
return;
|
||||||
|
total = (mibs[MIB_V_PAGE_COUNT].value -
|
||||||
|
mibs[MIB_V_WIRE_COUNT].value) << pshift;
|
||||||
|
x_used = (mibs[MIB_V_ACTIVE_COUNT].value +
|
||||||
|
mibs[MIB_V_INACTIVE_COUNT].value) << pshift;
|
||||||
|
free = mibs[MIB_V_FREE_COUNT].value << pshift;
|
||||||
|
if (sysctl(oid_vmt, 2, &vmt, &length_vmt, NULL, 0) == 0)
|
||||||
|
shared = vmt.t_rmshr << pshift;
|
||||||
|
get_bufspace(&buffers);
|
||||||
|
cached = mibs[MIB_V_CACHE_COUNT].value << pshift;
|
||||||
|
used = x_used - buffers - cached;
|
||||||
|
gkrellm_mem_assign_data(total, used, free, shared, buffers, cached);
|
||||||
|
|
||||||
|
if (swappgsin < 0)
|
||||||
|
{
|
||||||
|
dpagein = 0;
|
||||||
|
dpageout = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dpagein = (mibs[MIB_V_SWAPPGSIN].value - swappgsin) << pshift;
|
||||||
|
dpageout = (mibs[MIB_V_SWAPPGSOUT].value - swappgsout) << pshift;
|
||||||
|
}
|
||||||
|
swappgsin = mibs[MIB_V_SWAPPGSIN].value;
|
||||||
|
swappgsout = mibs[MIB_V_SWAPPGSOUT].value;
|
||||||
|
#else
|
||||||
|
if (kvmd == NULL)
|
||||||
|
return;
|
||||||
if (nl_mem[0].n_type == 0)
|
if (nl_mem[0].n_type == 0)
|
||||||
if (kvm_nlist(kvmd, nl_mem) < 0 || nl_mem[0].n_type == 0)
|
if (kvm_nlist(kvmd, nl_mem) < 0 || nl_mem[0].n_type == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -1051,6 +1126,7 @@ gkrellm_sys_mem_read_data(void)
|
||||||
cached = sum.v_cache_count << pshift;
|
cached = sum.v_cache_count << pshift;
|
||||||
used = x_used - buffers - cached;
|
used = x_used - buffers - cached;
|
||||||
gkrellm_mem_assign_data(total, used, free, shared, buffers, cached);
|
gkrellm_mem_assign_data(total, used, free, shared, buffers, cached);
|
||||||
|
|
||||||
if (swappgsin < 0)
|
if (swappgsin < 0)
|
||||||
{
|
{
|
||||||
dpagein = 0;
|
dpagein = 0;
|
||||||
|
@ -1058,11 +1134,12 @@ gkrellm_sys_mem_read_data(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dpagein = (sum.v_swappgsin - swappgsin) << (pshift - 10);
|
dpagein = (sum.v_swappgsin - swappgsin) << pshift;
|
||||||
dpageout = (sum.v_swappgsout - swappgsout) << (pshift - 10);
|
dpageout = (sum.v_swappgsout - swappgsout) << pshift;
|
||||||
}
|
}
|
||||||
swappgsin = sum.v_swappgsin;
|
swappgsin = sum.v_swappgsin;
|
||||||
swappgsout = sum.v_swappgsout;
|
swappgsout = sum.v_swappgsout;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (dpagein > 0 || dpageout > 0 || first_time_done == 0)
|
if (dpagein > 0 || dpageout > 0 || first_time_done == 0)
|
||||||
{
|
{
|
||||||
|
@ -1090,8 +1167,8 @@ gkrellm_sys_mem_init(void)
|
||||||
/* ===================================================================== */
|
/* ===================================================================== */
|
||||||
/* Battery monitor interface */
|
/* Battery monitor interface */
|
||||||
|
|
||||||
|
#if defined(__i386__) || defined(__amd64__)
|
||||||
#if defined(__i386__)
|
#if defined(__i386__)
|
||||||
#include <osreldate.h>
|
|
||||||
#include <machine/apm_bios.h>
|
#include <machine/apm_bios.h>
|
||||||
#define APMDEV "/dev/apm"
|
#define APMDEV "/dev/apm"
|
||||||
|
|
||||||
|
@ -1099,6 +1176,7 @@ gkrellm_sys_mem_init(void)
|
||||||
#define L_ON_LINE 1
|
#define L_ON_LINE 1
|
||||||
#define L_CHARGING 3
|
#define L_CHARGING 3
|
||||||
#define L_UNKNOWN 0xFF
|
#define L_UNKNOWN 0xFF
|
||||||
|
#endif
|
||||||
|
|
||||||
/* following two definitions are taken from sys/dev/acpica/acpiio.h */
|
/* following two definitions are taken from sys/dev/acpica/acpiio.h */
|
||||||
#define ACPI_BATT_STAT_CHARGING 0x0002
|
#define ACPI_BATT_STAT_CHARGING 0x0002
|
||||||
|
@ -1125,16 +1203,18 @@ gkrellm_sys_battery_read_data(void)
|
||||||
size_t size;
|
size_t size;
|
||||||
int acpi_info[4];
|
int acpi_info[4];
|
||||||
int i;
|
int i;
|
||||||
|
#if defined(__i386__)
|
||||||
int f, r;
|
int f, r;
|
||||||
struct apm_info info;
|
struct apm_info info;
|
||||||
|
gint batt_num = 0;
|
||||||
|
#endif
|
||||||
gboolean available, on_line, charging;
|
gboolean available, on_line, charging;
|
||||||
gint percent, time_left;
|
gint percent, time_left;
|
||||||
gint batt_num = 0;
|
|
||||||
|
|
||||||
if (!first_time_done)
|
if (!first_time_done)
|
||||||
{
|
{
|
||||||
first_time_done = TRUE;
|
first_time_done = TRUE;
|
||||||
#ifdef ACPI_SUPPORTS_MULTIPLE_BATTERIES
|
#if defined(ACPI_SUPPORTS_MULTIPLE_BATTERIES) || defined(__amd64__)
|
||||||
/*
|
/*
|
||||||
* XXX: Disable getting battery information via ACPI
|
* XXX: Disable getting battery information via ACPI
|
||||||
* to support multiple batteries via APM sim until
|
* to support multiple batteries via APM sim until
|
||||||
|
@ -1174,6 +1254,7 @@ gkrellm_sys_battery_read_data(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__i386__)
|
||||||
if ((f = open(APMDEV, O_RDONLY)) == -1)
|
if ((f = open(APMDEV, O_RDONLY)) == -1)
|
||||||
return;
|
return;
|
||||||
if ((r = ioctl(f, APMIO_GETINFO, &info)) == -1) {
|
if ((r = ioctl(f, APMIO_GETINFO, &info)) == -1) {
|
||||||
|
@ -1231,6 +1312,7 @@ gkrellm_sys_battery_read_data(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
close(f);
|
close(f);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@ -1258,7 +1340,7 @@ gkrellm_sys_battery_init(void)
|
||||||
/* ===================================================================== */
|
/* ===================================================================== */
|
||||||
/* Sensor monitor interface */
|
/* Sensor monitor interface */
|
||||||
|
|
||||||
#if defined(__i386__)
|
#if defined(__i386__) || defined(__amd64__)
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -1286,7 +1368,6 @@ static VoltDefault voltdefault0[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <osreldate.h>
|
|
||||||
#include <machine/cpufunc.h>
|
#include <machine/cpufunc.h>
|
||||||
#if __FreeBSD_version >= 500042
|
#if __FreeBSD_version >= 500042
|
||||||
#include <dev/smbus/smb.h>
|
#include <dev/smbus/smb.h>
|
||||||
|
@ -1298,6 +1379,7 @@ static VoltDefault voltdefault0[] =
|
||||||
#define INTERFACE_IO 0
|
#define INTERFACE_IO 0
|
||||||
#define INTERFACE_SMB 1
|
#define INTERFACE_SMB 1
|
||||||
#define INTERFACE_ACPI 2
|
#define INTERFACE_ACPI 2
|
||||||
|
#define INTERFACE_CORETEMP 3 /* Already in Celsius */
|
||||||
|
|
||||||
/* Addresses to use for /dev/io */
|
/* Addresses to use for /dev/io */
|
||||||
#define WBIO1 0x295
|
#define WBIO1 0x295
|
||||||
|
@ -1331,7 +1413,7 @@ get_data(int iodev, u_char command, int interface, u_char *ret)
|
||||||
struct smbcmd cmd;
|
struct smbcmd cmd;
|
||||||
|
|
||||||
bzero(&cmd, sizeof(cmd));
|
bzero(&cmd, sizeof(cmd));
|
||||||
cmd.data.byte_ptr = &byte;
|
cmd.data.byte_ptr = (char *)&byte;
|
||||||
cmd.slave = 0x5a;
|
cmd.slave = 0x5a;
|
||||||
cmd.cmd = command;
|
cmd.cmd = command;
|
||||||
if (ioctl(iodev, SMB_READB, (caddr_t)&cmd) == -1)
|
if (ioctl(iodev, SMB_READB, (caddr_t)&cmd) == -1)
|
||||||
|
@ -1357,6 +1439,8 @@ gkrellm_sys_sensors_get_temperature(gchar *path, gint id,
|
||||||
|
|
||||||
{
|
{
|
||||||
u_char byte;
|
u_char byte;
|
||||||
|
int value;
|
||||||
|
size_t size;
|
||||||
|
|
||||||
if (interface == MBMON_INTERFACE)
|
if (interface == MBMON_INTERFACE)
|
||||||
{
|
{
|
||||||
|
@ -1366,15 +1450,24 @@ gkrellm_sys_sensors_get_temperature(gchar *path, gint id,
|
||||||
|
|
||||||
if (interface == INTERFACE_ACPI)
|
if (interface == INTERFACE_ACPI)
|
||||||
{
|
{
|
||||||
int value;
|
size = sizeof(value);
|
||||||
size_t size = sizeof(value);
|
|
||||||
|
|
||||||
if (sysctlbyname(path, &value, &size, NULL, 0) < 0)
|
if (sysctlbyname(path, &value, &size, NULL, 0) < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (temp)
|
if (temp)
|
||||||
*temp = (gfloat) TZ_KELVTOC(value);
|
*temp = (gfloat) TZ_KELVTOC(value);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (interface == INTERFACE_CORETEMP)
|
||||||
|
{
|
||||||
|
size = sizeof(value);
|
||||||
|
if (sysctlbyname(path, &value, &size, NULL, 0) < 0)
|
||||||
|
return FALSE;
|
||||||
|
if (temp)
|
||||||
|
*temp = (gfloat) value;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (get_data(iodev, LM78_TEMP, interface, &byte))
|
if (get_data(iodev, LM78_TEMP, interface, &byte))
|
||||||
{
|
{
|
||||||
if (temp)
|
if (temp)
|
||||||
|
@ -1447,7 +1540,7 @@ gkrellm_sys_sensors_init(void)
|
||||||
gchar mib_name[256], label[8];
|
gchar mib_name[256], label[8];
|
||||||
gint interface, id;
|
gint interface, id;
|
||||||
int oid_acpi_temp[CTL_MAXNAME + 2];
|
int oid_acpi_temp[CTL_MAXNAME + 2];
|
||||||
size_t oid_acpi_temp_len = sizeof(oid_acpi_temp);
|
size_t oid_acpi_temp_len;
|
||||||
GList *list;
|
GList *list;
|
||||||
struct freebsd_sensor *sensor;
|
struct freebsd_sensor *sensor;
|
||||||
|
|
||||||
|
@ -1455,10 +1548,12 @@ gkrellm_sys_sensors_init(void)
|
||||||
*/
|
*/
|
||||||
gkrellm_sys_sensors_mbmon_check(TRUE);
|
gkrellm_sys_sensors_mbmon_check(TRUE);
|
||||||
|
|
||||||
for (id = 0;;)
|
/* ACPI Thermal */
|
||||||
{
|
for (id = 0;; id++)
|
||||||
|
{
|
||||||
snprintf(mib_name, sizeof(mib_name),
|
snprintf(mib_name, sizeof(mib_name),
|
||||||
"hw.acpi.thermal.tz%d.temperature", id);
|
"hw.acpi.thermal.tz%d.temperature", id);
|
||||||
|
oid_acpi_temp_len = sizeof(oid_acpi_temp);
|
||||||
if (gk_sysctlnametomib(mib_name, oid_acpi_temp,
|
if (gk_sysctlnametomib(mib_name, oid_acpi_temp,
|
||||||
&oid_acpi_temp_len) < 0)
|
&oid_acpi_temp_len) < 0)
|
||||||
break;
|
break;
|
||||||
|
@ -1470,7 +1565,27 @@ gkrellm_sys_sensors_init(void)
|
||||||
gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, NULL,
|
gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, NULL,
|
||||||
mib_name, 0, 0,
|
mib_name, 0, 0,
|
||||||
interface, 1.0, 0.0, NULL, label);
|
interface, 1.0, 0.0, NULL, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Coretemp */
|
||||||
|
for (id = 0;; id++)
|
||||||
|
{
|
||||||
|
snprintf(mib_name, sizeof(mib_name),
|
||||||
|
"dev.cpu.%d.temperature", id);
|
||||||
|
oid_acpi_temp_len = sizeof(oid_acpi_temp);
|
||||||
|
if (gk_sysctlnametomib(mib_name, oid_acpi_temp,
|
||||||
|
&oid_acpi_temp_len) < 0)
|
||||||
|
break;
|
||||||
|
interface = INTERFACE_CORETEMP;
|
||||||
|
if (!gkrellm_sys_sensors_get_temperature(mib_name, 0, 0,
|
||||||
|
interface, NULL))
|
||||||
|
continue;
|
||||||
|
snprintf(label, sizeof(label), "cpu%d", id);
|
||||||
|
gkrellm_sensors_add_sensor(SENSOR_TEMPERATURE, NULL,
|
||||||
|
mib_name, 0, 0,
|
||||||
|
interface, 1.0, 0.0, NULL, label);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (freebsd_sensor_list)
|
if (freebsd_sensor_list)
|
||||||
{
|
{
|
||||||
|
@ -1504,13 +1619,7 @@ sensors_add_sensor(gint type, gchar *id_name, gint id, gint iodev, gint inter,
|
||||||
sensor->factor = factor;
|
sensor->factor = factor;
|
||||||
sensor->offset = offset;
|
sensor->offset = offset;
|
||||||
sensor->default_label = default_label ? g_strdup(default_label) : NULL;
|
sensor->default_label = default_label ? g_strdup(default_label) : NULL;
|
||||||
if (g_list_append(freebsd_sensor_list, sensor) == NULL) {
|
freebsd_sensor_list = g_list_append(freebsd_sensor_list, sensor);
|
||||||
g_free(sensor->id_name);
|
|
||||||
if (sensor->default_label)
|
|
||||||
g_free(sensor->default_label);
|
|
||||||
g_free(sensor);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -1804,10 +1804,15 @@ read_sysfs_entry (gchar *buf, gint buflen, gchar const *sysentry)
|
||||||
if (*nl == '\n')
|
if (*nl == '\n')
|
||||||
*nl = '\0';
|
*nl = '\0';
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
if (_GK.debug_level & DEBUG_BATTERY)
|
||||||
|
printf ("read_sysfs_entry: %s = %s\n",
|
||||||
|
sysentry, buf);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
fclose (f);
|
fclose (f);
|
||||||
}
|
}
|
||||||
|
if (_GK.debug_level & DEBUG_BATTERY)
|
||||||
|
printf ("read_sysfs_entry: cannot read %s\n", sysentry);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1873,7 +1878,8 @@ sysfs_power_data (struct syspower *sp)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
percent = charge_now * 100 / charge_full;
|
if (charge_full > 0)
|
||||||
|
percent = charge_now * 100 / charge_full;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get charging status. */
|
/* Get charging status. */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2007 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -805,15 +805,6 @@ gkrellm_sys_sensors_sf_init(void)
|
||||||
{
|
{
|
||||||
ret = TRUE; // Mark SpeedFan as available
|
ret = TRUE; // Mark SpeedFan as available
|
||||||
|
|
||||||
// Wait a bit for a running SpeedFan that has not detected all its sensors yet
|
|
||||||
i = 10;
|
|
||||||
while (i-- > 0)
|
|
||||||
{
|
|
||||||
if ((pData->NumTemps + pData->NumVolts + pData->NumFans) > 0)
|
|
||||||
break;
|
|
||||||
g_usleep(G_USEC_PER_SEC);
|
|
||||||
}
|
|
||||||
|
|
||||||
gkrellm_debug(DEBUG_SYSDEP, "Enumerating %hu temps, %hu voltages and %hu fans\n",
|
gkrellm_debug(DEBUG_SYSDEP, "Enumerating %hu temps, %hu voltages and %hu fans\n",
|
||||||
pData->NumTemps, pData->NumVolts, pData->NumFans);
|
pData->NumTemps, pData->NumVolts, pData->NumFans);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
@ -216,7 +216,7 @@ gkrellm_homedir(void)
|
||||||
|
|
||||||
homedir = (gchar *) g_get_home_dir();
|
homedir = (gchar *) g_get_home_dir();
|
||||||
if (!homedir)
|
if (!homedir)
|
||||||
homedir = "."; // FIXME: This does not look right to me (stefan)
|
homedir = ".";
|
||||||
return homedir;
|
return homedir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
| 2007-2008 Stefan Gehn
|
| 2007-2009 Stefan Gehn
|
||||||
|
|
|
|
||||||
| Authors: Bill Wilson billw@gkrellm.net
|
| Authors: Bill Wilson billw@gkrellm.net
|
||||||
| Stefan Gehn stefan@gkrellm.srcbox.net
|
| Stefan Gehn stefan@gkrellm.srcbox.net
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* GKrellM Windows Portion
|
/* GKrellM Windows Portion
|
||||||
| Copyright (C) 2002 Bill Nalen
|
| Copyright (C) 2002 Bill Nalen
|
||||||
| 2007-2008 Stefan Gehn
|
| 2007-2009 Stefan Gehn
|
||||||
|
|
|
|
||||||
| Authors: Bill Nalen bill@nalens.com
|
| Authors: Bill Nalen bill@nalens.com
|
||||||
| Stefan Gehn stefan@gkrellm.srcbox.net
|
| Stefan Gehn stefan@gkrellm.srcbox.net
|
||||||
|
|
|
@ -36,7 +36,7 @@ BEGIN
|
||||||
VALUE "FileDescription", "GKrellM"
|
VALUE "FileDescription", "GKrellM"
|
||||||
VALUE "FileVersion", RC_VER_STRING
|
VALUE "FileVersion", RC_VER_STRING
|
||||||
VALUE "InternalName", "gkrellm"
|
VALUE "InternalName", "gkrellm"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 1999-2008 Bill Wilson"
|
VALUE "LegalCopyright", "Copyright (C) 1999-2009 Bill Wilson"
|
||||||
VALUE "OriginalFilename", "gkrellm.exe"
|
VALUE "OriginalFilename", "gkrellm.exe"
|
||||||
VALUE "ProductName", "GKrellM"
|
VALUE "ProductName", "GKrellM"
|
||||||
VALUE "ProductVersion", RC_VER_STRING
|
VALUE "ProductVersion", RC_VER_STRING
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
| 2007-2008 Stefan Gehn
|
| 2007-2009 Stefan Gehn
|
||||||
|
|
|
|
||||||
| Authors: Bill Wilson billw@gkrellm.net
|
| Authors: Bill Wilson billw@gkrellm.net
|
||||||
| Stefan Gehn stefan@gkrellm.srcbox.net
|
| Stefan Gehn stefan@gkrellm.srcbox.net
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GKrellM
|
/* GKrellM
|
||||||
| Copyright (C) 1999-2008 Bill Wilson
|
| Copyright (C) 1999-2009 Bill Wilson
|
||||||
|
|
|
|
||||||
| Author: Bill Wilson billw@gkrellm.net
|
| Author: Bill Wilson billw@gkrellm.net
|
||||||
| Latest versions might be found at: http://gkrellm.net
|
| Latest versions might be found at: http://gkrellm.net
|
||||||
|
|
Loading…
Reference in New Issue