mirror of https://github.com/xzeldon/htop.git
Sync changes from master and fix minor warnings
This commit is contained in:
parent
4b49de44a8
commit
db98623684
18
Makefile.am
18
Makefile.am
|
@ -240,22 +240,24 @@ endif
|
||||||
# -------
|
# -------
|
||||||
|
|
||||||
netbsd_platform_headers = \
|
netbsd_platform_headers = \
|
||||||
|
generic/gettime.h \
|
||||||
|
generic/hostname.h \
|
||||||
|
generic/uname.h \
|
||||||
netbsd/Platform.h \
|
netbsd/Platform.h \
|
||||||
netbsd/ProcessField.h \
|
netbsd/ProcessField.h \
|
||||||
netbsd/NetBSDProcessList.h \
|
|
||||||
netbsd/NetBSDProcess.h \
|
netbsd/NetBSDProcess.h \
|
||||||
generic/hostname.h \
|
netbsd/NetBSDProcessList.h
|
||||||
generic/uname.h
|
|
||||||
|
|
||||||
netbsd_platform_sources = \
|
netbsd_platform_sources = \
|
||||||
netbsd/Platform.c \
|
generic/gettime.c \
|
||||||
netbsd/NetBSDProcessList.c \
|
|
||||||
netbsd/NetBSDProcess.c \
|
|
||||||
generic/hostname.c \
|
generic/hostname.c \
|
||||||
generic/uname.c
|
generic/uname.c \
|
||||||
|
netbsd/Platform.c \
|
||||||
|
netbsd/NetBSDProcess.c \
|
||||||
|
netbsd/NetBSDProcessList.c
|
||||||
|
|
||||||
if HTOP_NETBSD
|
if HTOP_NETBSD
|
||||||
AM_LDFLAGS += -lkvm
|
myhtopplatprogram = htop
|
||||||
myhtopplatheaders = $(netbsd_platform_headers)
|
myhtopplatheaders = $(netbsd_platform_headers)
|
||||||
myhtopplatsources = $(netbsd_platform_sources)
|
myhtopplatsources = $(netbsd_platform_sources)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -62,7 +62,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, ui
|
||||||
CRT_fatalError("pagesize sysconf call failed");
|
CRT_fatalError("pagesize sysconf call failed");
|
||||||
pageSizeKB = pageSize / ONE_K;
|
pageSizeKB = pageSize / ONE_K;
|
||||||
|
|
||||||
for (int i = 0; i <= pl->cpuCount; i++) {
|
for (unsigned int i = 0; i <= pl->cpuCount; i++) {
|
||||||
CPUData* d = opl->cpus + i;
|
CPUData* d = opl->cpus + i;
|
||||||
d->totalTime = 1;
|
d->totalTime = 1;
|
||||||
d->totalPeriod = 1;
|
d->totalPeriod = 1;
|
||||||
|
@ -361,7 +361,7 @@ static void NetBSDProcessList_scanCPUTime(NetBSDProcessList* this) {
|
||||||
u_int64_t kernelTimes[CPUSTATES] = {0};
|
u_int64_t kernelTimes[CPUSTATES] = {0};
|
||||||
u_int64_t avg[CPUSTATES] = {0};
|
u_int64_t avg[CPUSTATES] = {0};
|
||||||
|
|
||||||
for (int i = 0; i < this->super.cpuCount; i++) {
|
for (unsigned int i = 0; i < this->super.cpuCount; i++) {
|
||||||
getKernelCPUTimes(i, kernelTimes);
|
getKernelCPUTimes(i, kernelTimes);
|
||||||
CPUData* cpu = this->cpus + i + 1;
|
CPUData* cpu = this->cpus + i + 1;
|
||||||
kernelCPUTimesToHtop(kernelTimes, cpu);
|
kernelCPUTimesToHtop(kernelTimes, cpu);
|
||||||
|
|
|
@ -19,10 +19,15 @@ in the source distribution for its full text.
|
||||||
#include "Process.h"
|
#include "Process.h"
|
||||||
#include "ProcessLocksScreen.h"
|
#include "ProcessLocksScreen.h"
|
||||||
#include "SignalsPanel.h"
|
#include "SignalsPanel.h"
|
||||||
|
#include "generic/gettime.h"
|
||||||
#include "generic/hostname.h"
|
#include "generic/hostname.h"
|
||||||
#include "generic/uname.h"
|
#include "generic/uname.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* There are no Long Options for NetBSD as of now. */
|
||||||
|
#define PLATFORM_LONG_OPTIONS \
|
||||||
|
// End of list
|
||||||
|
|
||||||
extern const ProcessField Platform_defaultFields[];
|
extern const ProcessField Platform_defaultFields[];
|
||||||
|
|
||||||
/* see /usr/include/sys/signal.h */
|
/* see /usr/include/sys/signal.h */
|
||||||
|
@ -70,4 +75,18 @@ static inline void Platform_getRelease(char** string) {
|
||||||
*string = Generic_uname();
|
*string = Generic_uname();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { }
|
||||||
|
|
||||||
|
static inline bool Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) {
|
||||||
|
Generic_gettime_realtime(tv, msec);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void Platform_gettime_monotonic(uint64_t* msec) {
|
||||||
|
Generic_gettime_monotonic(msec);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue