mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
More work on opensolaris...
Cleaning some warnings. Added checks for kstat, so cpu applet can show usage via kstat api. Added tests for kstat in configure script.
This commit is contained in:
@@ -9,6 +9,10 @@
|
||||
* For ede-panel by Sanel Zukan 2009
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <stdarg.h>
|
||||
@@ -26,8 +30,10 @@
|
||||
# include <sys/sysinfo.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_KSTAT_H
|
||||
#ifdef HAVE_KSTAT
|
||||
# include <kstat.h>
|
||||
# include <sys/sysinfo.h>
|
||||
# include <string.h> /* strncmp */
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
@@ -335,11 +341,10 @@ void CPUMonitor::get_cpu_info() {
|
||||
|
||||
#endif /* linux */
|
||||
|
||||
#ifdef HAVE_KSTAT_H
|
||||
#ifdef HAVE_KSTAT
|
||||
# ifdef HAVE_OLD_KSTAT
|
||||
# define ui32 ul
|
||||
#endif
|
||||
|
||||
static kstat_ctl_t *kc = NULL;
|
||||
static kid_t kcid;
|
||||
kid_t new_kcid;
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
|
||||
SubDir TOP ede-panel applets cpu-monitor ;
|
||||
|
||||
PanelApplet cpu_monitor : CpuMonitor.cpp ;
|
||||
PanelApplet cpu_monitor : CpuMonitor.cpp : $(KSTAT_LIBS) ;
|
||||
|
||||
@@ -184,9 +184,8 @@ void StartMenu::popup(void) {
|
||||
pressed_menu_button = this;
|
||||
redraw();
|
||||
|
||||
Fl_Widget *mb = this;
|
||||
|
||||
#if (FL_MAJOR_VERSION >= 1) && (FL_MINOR_VERSION >= 3)
|
||||
Fl_Widget *mb = this;
|
||||
Fl::watch_widget_pointer(mb);
|
||||
#endif
|
||||
|
||||
@@ -287,7 +286,7 @@ bool StartMenu::can_reload(void) {
|
||||
time_t c, diff;
|
||||
|
||||
c = time(NULL);
|
||||
diff = difftime(c, last_reload);
|
||||
diff = (time_t)difftime(c, last_reload);
|
||||
last_reload = c;
|
||||
|
||||
if(diff >= MENU_UPDATE_DIFF) return true;
|
||||
|
||||
Reference in New Issue
Block a user