127 lines
2.7 KiB
Diff
127 lines
2.7 KiB
Diff
--- ksysguardd/Command.c
|
|
+++ ksysguardd/Command.c
|
|
@@ -19,6 +19,7 @@
|
|
|
|
*/
|
|
|
|
+#define _POSIX_C_SOURCE /* sig.*set */
|
|
#include <signal.h>
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
--- ksysguardd/Linux/ProcessList.c
|
|
+++ ksysguardd/Linux/ProcessList.c
|
|
@@ -18,6 +18,9 @@
|
|
|
|
*/
|
|
|
|
+#define _BSD_SOURCE /* kill, syscall */
|
|
+#define _DEFAULT_SOURCE /* Eliminate warning from prev */
|
|
+
|
|
#include <ctype.h>
|
|
#include <dirent.h>
|
|
#include <errno.h>
|
|
@@ -29,6 +32,7 @@
|
|
#include <sys/resource.h>
|
|
#include <time.h>
|
|
#include <unistd.h>
|
|
+#include <sys/syscall.h>
|
|
#include <sys/ptrace.h>
|
|
#include <asm/unistd.h>
|
|
|
|
--- ksysguardd/Linux/diskstat.c
|
|
+++ ksysguardd/Linux/diskstat.c
|
|
@@ -20,6 +20,8 @@
|
|
|
|
#include <config-workspace.h>
|
|
|
|
+#define _XOPEN_SOURCE /* isascii */
|
|
+
|
|
#include <mntent.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
@@ -63,8 +65,10 @@ char *getMntPnt( const char* cmd )
|
|
memset( device, 0, sizeof( device ) );
|
|
sscanf( cmd, "partitions%1024s", device );
|
|
|
|
- ptr = (char*)rindex( device, '/' );
|
|
- *ptr = '\0';
|
|
+ ptr = strrchr( device, '/' );
|
|
+ if( ptr ) {
|
|
+ *ptr = '\0';
|
|
+ }
|
|
|
|
return (char*)device;
|
|
}
|
|
--- ksysguardd/Linux/netstat.c
|
|
+++ ksysguardd/Linux/netstat.c
|
|
@@ -20,8 +20,11 @@
|
|
|
|
#include <config-workspace.h>
|
|
|
|
+#define _POSIX_SOURCE /* expose old gethostbyaddr(3) call */
|
|
#include <arpa/inet.h>
|
|
#include <netdb.h>
|
|
+#include <sys/types.h>
|
|
+#include <sys/socket.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
@@ -264,10 +267,10 @@ updateNetStatTcpUdpRaw(const char *cmd)
|
|
{
|
|
FILE *netstat;
|
|
char buffer[1024];
|
|
- uint local_addr, local_port;
|
|
- uint remote_addr, remote_port;
|
|
+ unsigned local_addr, local_port;
|
|
+ unsigned remote_addr, remote_port;
|
|
int uid;
|
|
- uint state;
|
|
+ unsigned state;
|
|
SocketInfo *socket_info;
|
|
|
|
if (strstr(cmd, "tcp")) {
|
|
--- ksysguardd/Linux/softraid.c
|
|
+++ ksysguardd/Linux/softraid.c
|
|
@@ -21,6 +21,7 @@
|
|
#include "ksysguardd.h"
|
|
#include "softraid.h"
|
|
|
|
+#define _POSIX_C_SOURCE 200809L /* strndup */
|
|
#include <string.h> /* for strlen, strcat and strcmp */
|
|
#include <stdio.h> /* for sprintf */
|
|
#include <sys/types.h> /* for open */
|
|
--- ksysguardd/PWUIDCache.c
|
|
+++ ksysguardd/PWUIDCache.c
|
|
@@ -18,6 +18,8 @@
|
|
|
|
*/
|
|
|
|
+#define _POSIX_C_SOURCE 200809L /* strdup */
|
|
+
|
|
#include <pwd.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
--- ksysguardd/conf.c
|
|
+++ ksysguardd/conf.c
|
|
@@ -20,6 +20,7 @@
|
|
|
|
#include "config-ksysguardd.h"
|
|
|
|
+#define _POSIX_C_SOURCE 200809L /* strdup */
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
--- ksysguardd/ksysguardd.c
|
|
+++ ksysguardd/ksysguardd.c
|
|
@@ -22,6 +22,9 @@
|
|
|
|
*/
|
|
|
|
+/* strdup, fileno, fdopen */
|
|
+#define _POSIX_C_SOURCE 200809L
|
|
+
|
|
#include <config-workspace.h>
|
|
#include <ctype.h>
|
|
#include <fcntl.h>
|
|
|