summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorDaniel Flanagan <daniel@lytedev.io>2019-10-31 11:39:12 -0500
committerDaniel Flanagan <daniel@lytedev.io>2019-10-31 11:39:12 -0500
commitdd33444f7eace81115308eadb568020470c48b2b (patch)
treeb13c2a7f17cc64458016d396829e95ef5cea9294 /linux
parent28840683cfc5d48307b9b0f382f55f8c84d6a0c4 (diff)
Clean up existing whitespace
Diffstat (limited to 'linux')
-rw-r--r--linux/Battery.c8
-rw-r--r--linux/IOPriority.c2
-rw-r--r--linux/IOPriority.h2
-rw-r--r--linux/LinuxProcess.c4
-rw-r--r--linux/LinuxProcess.h2
-rw-r--r--linux/LinuxProcessList.c38
-rw-r--r--linux/LinuxProcessList.h6
7 files changed, 31 insertions, 31 deletions
diff --git a/linux/Battery.c b/linux/Battery.c
index aedacabc..7b9e79a1 100644
--- a/linux/Battery.c
+++ b/linux/Battery.c
@@ -78,7 +78,7 @@ static unsigned long int parseBatInfo(const char *fileName, const unsigned short
const unsigned long int foundNum = atoi(foundNumStr);
free(foundNumStr);
free(line);
-
+
total += foundNum;
}
@@ -175,7 +175,7 @@ static inline ssize_t xread(int fd, void *buf, size_t count) {
}
static void Battery_getSysData(double* level, ACPresence* isOnAC) {
-
+
*level = 0;
*isOnAC = AC_ERROR;
@@ -194,7 +194,7 @@ static void Battery_getSysData(double* level, ACPresence* isOnAC) {
const char filePath[50];
if (entryName[0] == 'B' && entryName[1] == 'A' && entryName[2] == 'T') {
-
+
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/uevent", entryName);
int fd = open(filePath, O_RDONLY);
if (fd == -1) {
@@ -247,7 +247,7 @@ static void Battery_getSysData(double* level, ACPresence* isOnAC) {
if (*isOnAC != AC_ERROR) {
continue;
}
-
+
xSnprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/online", entryName);
int fd = open(filePath, O_RDONLY);
if (fd == -1) {
diff --git a/linux/IOPriority.c b/linux/IOPriority.c
index dd7c84a1..80007df0 100644
--- a/linux/IOPriority.c
+++ b/linux/IOPriority.c
@@ -4,7 +4,7 @@ htop - IOPriority.c
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
-Based on ionice,
+Based on ionice,
Copyright (C) 2005 Jens Axboe <jens@axboe.dk>
Released under the terms of the GNU General Public License version 2
*/
diff --git a/linux/IOPriority.h b/linux/IOPriority.h
index 148e344c..1c9ca95b 100644
--- a/linux/IOPriority.h
+++ b/linux/IOPriority.h
@@ -8,7 +8,7 @@ htop - IOPriority.h
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
-Based on ionice,
+Based on ionice,
Copyright (C) 2005 Jens Axboe <jens@axboe.dk>
Released under the terms of the GNU General Public License version 2
*/
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
index 5f697078..3bedbf66 100644
--- a/linux/LinuxProcess.c
+++ b/linux/LinuxProcess.c
@@ -117,7 +117,7 @@ typedef struct LinuxProcess_ {
unsigned long long io_write_bytes;
unsigned long long io_cancelled_write_bytes;
unsigned long long io_rate_read_time;
- unsigned long long io_rate_write_time;
+ unsigned long long io_rate_write_time;
double io_rate_read_bps;
double io_rate_write_bps;
#endif
@@ -394,7 +394,7 @@ void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field)
attr = CRT_colors[PROCESS_HIGH_PRIORITY];
xSnprintf(buffer, n, "R%1d ", IOPriority_data(lp->ioPriority));
} else if (klass == IOPRIO_CLASS_IDLE) {
- attr = CRT_colors[PROCESS_LOW_PRIORITY];
+ attr = CRT_colors[PROCESS_LOW_PRIORITY];
xSnprintf(buffer, n, "id ");
} else {
xSnprintf(buffer, n, "?? ");
diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h
index 6ce3037d..4b81539f 100644
--- a/linux/LinuxProcess.h
+++ b/linux/LinuxProcess.h
@@ -108,7 +108,7 @@ typedef struct LinuxProcess_ {
unsigned long long io_write_bytes;
unsigned long long io_cancelled_write_bytes;
unsigned long long io_rate_read_time;
- unsigned long long io_rate_write_time;
+ unsigned long long io_rate_write_time;
double io_rate_read_bps;
double io_rate_write_bps;
#endif
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 5f38540c..ec543be6 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -62,7 +62,7 @@ typedef struct CPUData_ {
unsigned long long int softIrqTime;
unsigned long long int stealTime;
unsigned long long int guestTime;
-
+
unsigned long long int totalPeriod;
unsigned long long int userPeriod;
unsigned long long int systemPeriod;
@@ -86,10 +86,10 @@ typedef struct TtyDriver_ {
typedef struct LinuxProcessList_ {
ProcessList super;
-
+
CPUData* cpus;
TtyDriver* ttyDrivers;
-
+
#ifdef HAVE_DELAYACCT
struct nl_sock *netlink_socket;
int netlink_family;
@@ -319,7 +319,7 @@ static bool LinuxProcessList_readStatFile(Process *process, const char* dirname,
location += 2;
char *end = strrchr(location, ')');
if (!end) return false;
-
+
int commsize = end - location;
memcpy(command, location, commsize);
command[commsize] = '\0';
@@ -370,9 +370,9 @@ static bool LinuxProcessList_readStatFile(Process *process, const char* dirname,
location += 1;
assert(location != NULL);
process->processor = strtol(location, &location, 10);
-
+
process->time = lp->utime + lp->stime;
-
+
return true;
}
@@ -412,7 +412,7 @@ static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirna
process->io_rate_write_time = -1LL;
return;
}
-
+
char buffer[1024];
ssize_t buflen = xread(fd, buffer, 1023);
close(fd);
@@ -429,7 +429,7 @@ static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirna
process->io_rchar = strtoull(line+7, NULL, 10);
else if (strncmp(line+1, "ead_bytes: ", 11) == 0) {
process->io_read_bytes = strtoull(line+12, NULL, 10);
- process->io_rate_read_bps =
+ process->io_rate_read_bps =
((double)(process->io_read_bytes - last_read))/(((double)(now - process->io_rate_read_time))/1000);
process->io_rate_read_time = now;
}
@@ -439,7 +439,7 @@ static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirna
process->io_wchar = strtoull(line+7, NULL, 10);
else if (strncmp(line+1, "rite_bytes: ", 12) == 0) {
process->io_write_bytes = strtoull(line+13, NULL, 10);
- process->io_rate_write_bps =
+ process->io_rate_write_bps =
((double)(process->io_write_bytes - last_write))/(((double)(now - process->io_rate_write_time))/1000);
process->io_rate_write_time = now;
}
@@ -661,7 +661,7 @@ static void LinuxProcessList_readDelayAcctData(LinuxProcessList* this, LinuxProc
process->cpu_delay_percent = -1LL;
return;
}
-
+
if (nl_recvmsgs_default(this->netlink_socket) < 0) {
return;
}
@@ -685,11 +685,11 @@ static bool LinuxProcessList_readCmdlineFile(Process* process, const char* dirna
int fd = open(filename, O_RDONLY);
if (fd == -1)
return false;
-
+
char command[4096+1]; // max cmdline length on Linux
int amtRead = xread(fd, command, sizeof(command) - 1);
close(fd);
- int tokenEnd = 0;
+ int tokenEnd = 0;
int lastChar = 0;
if (amtRead == 0) {
((LinuxProcess*)process)->isKernelThread = true;
@@ -726,13 +726,13 @@ static char* LinuxProcessList_updateTtyDevice(TtyDriver* ttyDrivers, unsigned in
i++;
if ((!ttyDrivers[i].path) || maj < ttyDrivers[i].major) {
break;
- }
+ }
if (maj > ttyDrivers[i].major) {
continue;
}
if (min < ttyDrivers[i].minorFrom) {
break;
- }
+ }
if (min > ttyDrivers[i].minorTo) {
continue;
}
@@ -790,17 +790,17 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
// filename is a number: process directory
int pid = atoi(name);
-
+
if (parent && pid == parent->pid)
continue;
- if (pid <= 0)
+ if (pid <= 0)
continue;
bool preExisting = false;
Process* proc = ProcessList_getProcess(pl, pid, &preExisting, (Process_New) LinuxProcess_new);
proc->tgid = parent ? parent->pid : pid;
-
+
LinuxProcess* lp = (LinuxProcess*) proc;
char subdirname[MAX_NAME+1];
@@ -846,7 +846,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
LinuxProcessList_readOpenVZData(lp, dirname, name);
}
#endif
-
+
#ifdef HAVE_VSERVER
if (settings->flags & PROCESS_FLAG_LINUX_VSERVER) {
LinuxProcessList_readVServerData(lp, dirname, name);
@@ -874,7 +874,7 @@ static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char*
if (settings->flags & PROCESS_FLAG_LINUX_CGROUP)
LinuxProcessList_readCGroupFile(lp, dirname, name);
#endif
-
+
if (settings->flags & PROCESS_FLAG_LINUX_OOM)
LinuxProcessList_readOomData(lp, dirname, name);
diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h
index f30b487d..81f87a59 100644
--- a/linux/LinuxProcessList.h
+++ b/linux/LinuxProcessList.h
@@ -35,7 +35,7 @@ typedef struct CPUData_ {
unsigned long long int softIrqTime;
unsigned long long int stealTime;
unsigned long long int guestTime;
-
+
unsigned long long int totalPeriod;
unsigned long long int userPeriod;
unsigned long long int systemPeriod;
@@ -59,10 +59,10 @@ typedef struct TtyDriver_ {
typedef struct LinuxProcessList_ {
ProcessList super;
-
+
CPUData* cpus;
TtyDriver* ttyDrivers;
-
+
#ifdef HAVE_DELAYACCT
struct nl_sock *netlink_socket;
int netlink_family;

© 2014-2024 Faster IT GmbH | imprint | privacy policy