* src/nethogs.h: Including files for PATH_MAX and readlink.

* src/nethogs.cpp: Bug fix - make capability detection work correctly when invoking a program in PATH rather than only when invoked explicitly like ./src/nethogs.
This commit is contained in:
rain1
2016-04-14 12:31:13 +00:00
parent a5fbdc1910
commit 2ab1306246
2 changed files with 3 additions and 1 deletions

View File

@@ -39,6 +39,8 @@
#include <netinet/udp.h> #include <netinet/udp.h>
#if NEEDROOT == 0 #if NEEDROOT == 0
#include <linux/limits.h>
#include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/xattr.h> #include <sys/xattr.h>
#include <linux/capability.h> #include <linux/capability.h>

View File

@@ -53,7 +53,7 @@
* like www.adamantix.org: in that case nethogs shouldn't check if it's * like www.adamantix.org: in that case nethogs shouldn't check if it's
* running as root. Take care to give it sufficient privileges though. */ * running as root. Take care to give it sufficient privileges though. */
#ifndef NEEDROOT #ifndef NEEDROOT
#define NEEDROOT 1 #define NEEDROOT 0
#endif #endif
#define DEBUG 0 #define DEBUG 0