summaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2006-03-13 17:29:18 +0000
committerHisham Muhammad <hisham@gobolinux.org>2006-03-13 17:29:18 +0000
commit2ef1847a8bca063b9ad88797fa66ce802a3f72d7 (patch)
treecd4085aedd29f2dffb39be58e63e941d1a9033f3 /htop.c
parent5268ff8c675ce06db1f1ce447598ebd94267238f (diff)
Complete implementation of --with-proc, making htop more FreeBSD-friendly
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/htop.c b/htop.c
index 06009ac9..2e492b3c 100644
--- a/htop.c
+++ b/htop.c
@@ -12,6 +12,11 @@ in the source distribution for its full text.
#include <ctype.h>
#include <stdbool.h>
+#ifndef CONFIG_H
+#define CONFIG_H
+#include "config.h"
+#endif
+
#include "ProcessList.h"
#include "CRT.h"
#include "ListBox.h"
@@ -26,7 +31,6 @@ in the source distribution for its full text.
#include "SignalsListBox.h"
#include "TraceScreen.h"
-#include "config.h"
#include "debug.h"
//#link m
@@ -213,6 +217,11 @@ int main(int argc, char** argv) {
setUserOnly(argv[2], &userOnly, &userId);
}
}
+
+ if (access(PROCDIR, R_OK) != 0) {
+ fprintf(stderr, "Error: could not read procfs (compiled to look in %s).\n", PROCDIR);
+ exit(1);
+ }
ListBox* lb;
int quit = 0;

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