diff options
author | Will Andrews <will@FreeBSD.org> | 2002-04-21 23:47:50 +0000 |
---|---|---|
committer | Will Andrews <will@FreeBSD.org> | 2002-04-21 23:47:50 +0000 |
commit | d1c2f0dddd4a74a79847b017915f3482671e055c (patch) | |
tree | 31ccd02a7c0d295ec66bf2eefa0f980fbb92cb91 /x11/kdebase4/files | |
parent | 98cff2373c59f930df3569d05871d0343d443fd8 (diff) |
Notes
Diffstat (limited to 'x11/kdebase4/files')
27 files changed, 514 insertions, 1454 deletions
diff --git a/x11/kdebase4/files/patch-apm.c b/x11/kdebase4/files/patch-apm.c deleted file mode 100644 index 08925da1dee5..000000000000 --- a/x11/kdebase4/files/patch-apm.c +++ /dev/null @@ -1,101 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/apm.c Mon Nov 19 17:06:33 2001 -@@ -0,0 +1,98 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: apm.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#include <fcntl.h> -+#include <machine/apm_bios.h> -+#include <stdio.h> -+ -+#include "Command.h" -+#include "apm.h" -+#include "ksysguardd.h" -+ -+static int ApmFD, BattFill, BattTime; -+ -+#define APMDEV "/dev/apm" -+ -+/* -+================================ public part ================================= -+*/ -+ -+void -+initApm(void) -+{ -+ if ((ApmFD = open(APMDEV, O_RDONLY)) < 0) -+ return; -+ -+ if (updateApm() < 0) -+ return; -+ -+ registerMonitor("apm/batterycharge", "integer", printApmBatFill, -+ printApmBatFillInfo); -+ registerMonitor("apm/remainingtime", "integer", printApmBatTime, -+ printApmBatTimeInfo); -+} -+ -+void -+exitApm(void) -+{ -+ removeMonitor("apm/batterycharge"); -+ removeMonitor("apm/remainingtime"); -+ -+ close(ApmFD); -+} -+ -+int -+updateApm(void) -+{ -+ struct apm_info info; -+ int retval; -+ -+ retval = ioctl(ApmFD, APMIO_GETINFO, &info); -+ -+ BattFill = info.ai_batt_life; -+ BattTime = info.ai_batt_time; -+ -+ return retval; -+} -+ -+void -+printApmBatFill(const char* c) -+{ -+ fprintf(CurrentClient, "%d\n", BattFill); -+} -+ -+void -+printApmBatFillInfo(const char* c) -+{ -+ fprintf(CurrentClient, "Battery charge\t0\t100\t%%\n"); -+} -+ -+void -+printApmBatTime(const char* c) -+{ -+ fprintf(CurrentClient, "%d\n", BattTime); -+} -+ -+void -+printApmBatTimeInfo(const char* c) -+{ -+ fprintf(CurrentClient, "Remaining battery time\t0\t0\tmin\n"); -+} diff --git a/x11/kdebase4/files/patch-apm.h b/x11/kdebase4/files/patch-apm.h deleted file mode 100644 index 73e509bdd61b..000000000000 --- a/x11/kdebase4/files/patch-apm.h +++ /dev/null @@ -1,37 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/apm.h Mon Nov 19 17:06:33 2001 -@@ -0,0 +1,34 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: apm.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#ifndef _apm_h_ -+#define _apm_h_ -+ -+void initApm(void); -+void exitApm(void); -+int updateApm(void); -+ -+void printApmBatFill(const char*); -+void printApmBatFillInfo(const char*); -+void printApmBatTime(const char*); -+void printApmBatTimeInfo(const char*); -+ -+#endif diff --git a/x11/kdebase4/files/patch-client.c b/x11/kdebase4/files/patch-client.c new file mode 100644 index 000000000000..6c54790a82de --- /dev/null +++ b/x11/kdebase4/files/patch-client.c @@ -0,0 +1,79 @@ +--- ./kdm/backend/client.c.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/backend/client.c Thu Apr 18 20:53:44 2002 +@@ -52,6 +52,12 @@ + #ifdef K5AUTH + # include <krb5/krb5.h> + #endif ++#ifdef CSRG_BASED ++# ifdef HAS_SETUSERCONTEXT ++# include <login_cap.h> ++# define USE_LOGIN_CAP 1 ++# endif ++#endif + #ifdef USE_PAM + # include <security/pam_appl.h> + #elif defined(AIXV3) /* USE_PAM */ +@@ -71,13 +77,6 @@ + # include <kafs.h> + # endif + # endif +-# ifdef CSRG_BASED +-# include <sys/param.h> +-# ifdef HAS_SETUSERCONTEXT +-# include <login_cap.h> +-# define USE_LOGIN_CAP 1 +-# endif +-# endif + /* for nologin */ + # include <sys/types.h> + # include <unistd.h> +@@ -867,12 +866,11 @@ + char *msg; + char **theenv; + extern char **newenv; /* from libs.a, this is set up by setpenv */ +-# else +-# ifdef HAS_SETUSERCONTEXT +- extern char **environ; +-# endif + # endif + #endif ++#ifdef HAS_SETUSERCONTEXT ++ extern char **environ; ++#endif + char *failsafeArgv[2]; + struct verify_info *verify; + int i, pid; +@@ -1004,10 +1002,11 @@ + + #ifndef AIXV3 + +-# if !defined(HAS_SETUSERCONTEXT) || defined(USE_PAM) ++# ifndef HAS_SETUSERCONTEXT + if (!SetGid (name, verify->gid)) + exit (1); +-# ifdef USE_PAM ++# endif ++# ifdef USE_PAM + pam_setcred(pamh, 0); + /* pass in environment variables set by libpam and modules it called */ + pam_env = pam_getenvlist(pamh); +@@ -1015,7 +1014,8 @@ + if (pam_env) + for(; *pam_env; pam_env++) + verify->userEnviron = putEnv(*pam_env, verify->userEnviron); +-# endif ++# endif ++# ifndef HAS_SETUSERCONTEXT + # if defined(BSD) && (BSD >= 199103) + if (setlogin(name) < 0) + { +@@ -1025,7 +1025,8 @@ + # endif + if (!SetUid (name, verify->uid)) + exit (1); +-# else /* HAS_SETUSERCONTEXT && !USE_PAM */ ++# else /* HAS_SETUSERCONTEXT */ ++ + /* + * Destroy environment unless user has requested its preservation. + * We need to do this before setusercontext() because that may diff --git a/x11/kdebase4/files/patch-conf.c b/x11/kdebase4/files/patch-conf.c deleted file mode 100644 index a4de97379b10..000000000000 --- a/x11/kdebase4/files/patch-conf.c +++ /dev/null @@ -1,136 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/conf.c Mon Nov 19 17:06:50 2001 -@@ -0,0 +1,133 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: conf.c,v 1.3 2001/11/05 23:24:19 tokoe Exp $ -+*/ -+ -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+ -+#include "Command.h" -+#include "ccont.h" -+#include "conf.h" -+ -+CONTAINER LogFileList = 0; -+CONTAINER SensorList = 0; -+ -+void parseConfigFile(const char *filename) -+{ -+ FILE* config; -+ char line[2048]; -+ char *begin, *token, *tmp, *confSensor; -+ ConfigLogFile *confLog; -+ -+ -+ if (LogFileList) -+ destr_ctnr(LogFileList, free); -+ -+ if (SensorList) -+ destr_ctnr(SensorList, free); -+ -+ LogFileList = new_ctnr(CT_DLL); -+ SensorList = new_ctnr(CT_DLL); -+ -+ if ((config = fopen(filename, "r")) == NULL) { -+ log_error("can't open config file '%s'", filename); -+ -+ /* if we can't open a config file we have to add the -+ available sensors manually -+ */ -+ -+ confSensor = strdup("ProcessList"); -+ push_ctnr(SensorList, confSensor); -+ confSensor = strdup("Memory"); -+ push_ctnr(SensorList, confSensor); -+ confSensor = strdup("Stat"); -+ push_ctnr(SensorList, confSensor); -+ confSensor = strdup("NetDev"); -+ push_ctnr(SensorList, confSensor); -+ confSensor = strdup("NetStat"); -+ push_ctnr(SensorList, confSensor); -+ confSensor = strdup("CpuInfo"); -+ push_ctnr(SensorList, confSensor); -+ confSensor = strdup("LoadAvg"); -+ push_ctnr(SensorList, confSensor); -+ confSensor = strdup("DiskStat"); -+ push_ctnr(SensorList, confSensor); -+ confSensor = strdup("LogFile"); -+ push_ctnr(SensorList, confSensor); -+ -+ return; -+ } -+ -+ while (fgets(line, sizeof(line), config) != NULL) { -+ if ((line[0] == '#') || (strlen(line) == 0)) { -+ continue; -+ } -+ -+ if (strchr(line, '#')) -+ *(strchr(line, '#')) = '\0'; -+ -+ if (line[strlen(line) - 1] == '\n') -+ line[strlen(line) - 1] = '\0'; -+ -+ if (!strncmp(line, "LogFiles", 8)) { -+ begin = strchr(line, '='); -+ begin++; -+ -+ for (token = strtok(begin, ","); token; token = strtok(NULL, ",")) { -+ if ((confLog = (ConfigLogFile *)malloc(sizeof(ConfigLogFile))) == NULL) { -+ log_error("malloc() no free memory avail"); -+ continue; -+ } -+ confLog->name = strdup(token); -+ tmp = strchr(confLog->name, ':'); -+ *tmp = '\0'; -+ confLog->path = tmp; -+ confLog->path++; -+ -+ push_ctnr(LogFileList, confLog); -+ } -+ } -+ if (!strncmp(line, "Sensors", 7)) { -+ begin = strchr(line, '='); -+ begin++; -+ -+ for (token = strtok(begin, ","); token; token = strtok(NULL, ",")) { -+ confSensor = strdup(token); -+ push_ctnr(SensorList, confSensor); -+ } -+ } -+ } -+ -+ fclose(config); -+} -+ -+int sensorAvailable(const char *sensor) -+{ -+ int i; -+ -+ for (i = 0; i < level_ctnr(SensorList); i++) { -+ char* name = get_ctnr(SensorList, i); -+ if (!strcmp(name, sensor)) -+ return 1; -+ } -+ -+ return 0; -+} diff --git a/x11/kdebase4/files/patch-conf.h b/x11/kdebase4/files/patch-conf.h deleted file mode 100644 index 8aba2e520205..000000000000 --- a/x11/kdebase4/files/patch-conf.h +++ /dev/null @@ -1,37 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/conf.h Mon Nov 19 17:06:50 2001 -@@ -0,0 +1,34 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: conf.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#ifndef _conf_h_ -+#define _conf_h_ -+ -+typedef struct { -+ char *name; -+ char *path; -+} ConfigLogFile; -+ -+void parseConfigFile(const char *filename); -+ -+int sensorAvailable(const char* sensor); -+ -+#endif diff --git a/x11/kdebase4/files/patch-diskstat.c b/x11/kdebase4/files/patch-diskstat.c deleted file mode 100644 index 5535e580a673..000000000000 --- a/x11/kdebase4/files/patch-diskstat.c +++ /dev/null @@ -1,260 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/diskstat.c Mon Nov 19 17:07:01 2001 -@@ -0,0 +1,257 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: diskstat.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+#include <sys/param.h> -+#include <sys/stat.h> -+#include <sys/ucred.h> -+#include <sys/mount.h> -+#include <time.h> -+#include <unistd.h> -+ -+#include "Command.h" -+#include "ccont.h" -+#include "diskstat.h" -+#include "ksysguardd.h" -+ -+typedef struct { -+ char device[256]; -+ char mntpnt[256]; -+ long blocks; -+ long bfree; -+ long bused; -+ int bused_percent; -+} DiskInfo; -+ -+static CONTAINER DiskStatList = 0; -+ -+char *getMntPnt(const char *cmd) -+{ -+ static char device[1024]; -+ char *ptr; -+ -+ memset(device, 0, sizeof(device)); -+ sscanf(cmd, "partitions%1024s", device); -+ -+ ptr = (char *)rindex(device, '/'); -+ *ptr = '\0'; -+ -+ return (char *)device; -+} -+ -+int numMntPnt(void) -+{ -+ struct statfs *fs_info; -+ int i, n, counter = 0; -+ -+ n = getmntinfo(&fs_info, MNT_WAIT); -+ for (i = 0; i < n; i++) -+ if (strcmp(fs_info[i].f_fstypename, "procfs") && strcmp(fs_info[i].f_fstypename, "swap") && strcmp(fs_info[i].f_fstypename, "devfs")) -+ counter++; -+ -+ return counter; -+} -+ -+/* ------------------------------ public part --------------------------- */ -+ -+void initDiskStat(void) -+{ -+ char monitor[1024]; -+ int i; -+ -+ DiskStatList = new_ctnr(CT_DLL); -+ -+ updateDiskStat(); -+ -+ registerMonitor("partitions/list", "listview", printDiskStat, printDiskStatInfo); -+ -+ for (i = 0; i < level_ctnr(DiskStatList); i++) { -+ DiskInfo* disk_info = get_ctnr(DiskStatList, i); -+ snprintf(monitor, sizeof(monitor), "partitions%s/usedspace", disk_info->mntpnt); -+ registerMonitor(monitor, "integer", printDiskStatUsed, printDiskStatUsedInfo); -+ snprintf(monitor, sizeof(monitor), "partitions%s/freespace", disk_info->mntpnt); -+ registerMonitor(monitor, "integer", printDiskStatFree, printDiskStatFreeInfo); -+ snprintf(monitor, sizeof(monitor), "partitions%s/filllevel", disk_info->mntpnt); -+ registerMonitor(monitor, "integer", printDiskStatPercent, printDiskStatPercentInfo); -+ } -+} -+ -+void checkDiskStat(void) -+{ -+ if (numMntPnt() != level_ctnr(DiskStatList)) { -+ /* a filesystem was mounted or unmounted -+ so we do a reset */ -+ exitDiskStat(); -+ initDiskStat(); -+ } -+} -+ -+void exitDiskStat(void) -+{ -+ DiskInfo *disk_info; -+ char monitor[1024]; -+ int i; -+ -+ removeMonitor("partitions/list"); -+ -+ for (i = 0; i < level_ctnr(DiskStatList); i++) { -+ disk_info = remove_ctnr(DiskStatList, i--); -+ -+ snprintf(monitor, sizeof(monitor), "partitions%s/usedspace", disk_info->mntpnt); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "partitions%s/freespace", disk_info->mntpnt); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "partitions%s/filllevel", disk_info->mntpnt); -+ removeMonitor(monitor); -+ -+ free(disk_info); -+ } -+ -+ if (DiskStatList) -+ destr_ctnr(DiskStatList, free); -+} -+ -+int updateDiskStat(void) -+{ -+ struct statfs *fs_info; -+ struct statfs fs; -+ float percent; -+ int i, mntcount; -+ DiskInfo *disk_info; -+ -+ /* let's hope there is no difference between the DiskStatList and -+ the number of mounted filesystems */ -+ for (i = 0; i < level_ctnr(DiskStatList); i++) -+ free(remove_ctnr(DiskStatList, i--)); -+ -+ mntcount = getmntinfo(&fs_info, MNT_WAIT); -+ -+ for (i = 0; i < mntcount; i++) { -+ fs = fs_info[i]; -+ if (strcmp(fs.f_fstypename, "procfs") && strcmp(fs.f_fstypename, "devfs") && strcmp(fs.f_fstypename, "devfs")) { -+ percent = (((float)fs.f_blocks - (float)fs.f_bfree)/(float)fs.f_blocks); -+ percent = percent * 100; -+ if ((disk_info = (DiskInfo *)malloc(sizeof(DiskInfo))) == NULL) { -+ continue; -+ } -+ memset(disk_info, 0, sizeof(DiskInfo)); -+ strncpy(disk_info->device, fs.f_mntfromname, 255); -+ if (!strcmp(fs.f_mntonname, "/")) { -+ strncpy(disk_info->mntpnt, "/root", 6); -+ } else { -+ strncpy(disk_info->mntpnt, fs.f_mntonname, 255); -+ } -+ disk_info->blocks = fs.f_blocks; -+ disk_info->bfree = fs.f_bfree; -+ disk_info->bused = (fs.f_blocks - fs.f_bfree); -+ disk_info->bused_percent = (int)percent; -+ -+ push_ctnr(DiskStatList, disk_info); -+ } -+ } -+ -+ return 0; -+} -+ -+void printDiskStat(const char* cmd) -+{ -+ int i; -+ -+ for (i = 0; i < level_ctnr(DiskStatList); i++) { -+ DiskInfo* disk_info = get_ctnr(DiskStatList, i); -+ fprintf(CurrentClient, "%s\t%ld\t%ld\t%ld\t%d\t%s\n", -+ disk_info->device, -+ disk_info->blocks, -+ disk_info->bused, -+ disk_info->bfree, -+ disk_info->bused_percent, -+ disk_info->mntpnt); -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} -+ -+void printDiskStatInfo(const char* cmd) -+{ -+ fprintf(CurrentClient, "Device\tBlocks\tUsed\tAvailable\tUsed %%\tMountPoint\n"); -+} -+ -+void printDiskStatUsed(const char* cmd) -+{ -+ int i; -+ char *mntpnt = (char *)getMntPnt(cmd); -+ -+ for (i = 0; i < level_ctnr(DiskStatList); i++) { -+ DiskInfo* disk_info = get_ctnr(DiskStatList, i); -+ if (!strcmp(mntpnt, disk_info->mntpnt)) { -+ fprintf(CurrentClient, "%ld\n", disk_info->bused); -+ } -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} -+ -+void printDiskStatUsedInfo(const char* cmd) -+{ -+ fprintf(CurrentClient, "Used Blocks\t0\t-\tBlocks\n"); -+} -+ -+void printDiskStatFree(const char* cmd) -+{ -+ int i; -+ char *mntpnt = (char *)getMntPnt(cmd); -+ -+ for (i = 0; i < level_ctnr(DiskStatList); i++) { -+ DiskInfo* disk_info = get_ctnr(DiskStatList, i); -+ if (!strcmp(mntpnt, disk_info->mntpnt)) { -+ fprintf(CurrentClient, "%ld\n", disk_info->bfree); -+ } -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} -+ -+void printDiskStatFreeInfo(const char* cmd) -+{ -+ fprintf(CurrentClient, "Free Blocks\t0\t-\tBlocks\n"); -+} -+ -+void printDiskStatPercent(const char* cmd) -+{ -+ int i; -+ char *mntpnt = (char *)getMntPnt(cmd); -+ -+ for (i = 0; i < level_ctnr(DiskStatList); i++) { -+ DiskInfo* disk_info = get_ctnr(DiskStatList, i); -+ if (!strcmp(mntpnt, disk_info->mntpnt)) { -+ fprintf(CurrentClient, "%d\n", disk_info->bused_percent); -+ } -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} -+ -+void printDiskStatPercentInfo(const char* cmd) -+{ -+ fprintf(CurrentClient, "Used Blocks\t0\t100\t%%\n"); -+} diff --git a/x11/kdebase4/files/patch-diskstat.h b/x11/kdebase4/files/patch-diskstat.h deleted file mode 100644 index 3b5bf11b89c7..000000000000 --- a/x11/kdebase4/files/patch-diskstat.h +++ /dev/null @@ -1,44 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/diskstat.h Mon Nov 19 17:07:01 2001 -@@ -0,0 +1,41 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: diskstat.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#ifndef _diskstat_h_ -+#define _diskstat_h_ -+ -+void initDiskStat(void); -+void exitDiskStat(void); -+ -+int updateDiskStat(void); -+void checkDiskStat(void); -+ -+void printDiskStat(const char* cmd); -+void printDiskStatInfo(const char* cmd); -+ -+void printDiskStatUsed(const char* cmd); -+void printDiskStatUsedInfo(const char* cmd); -+void printDiskStatFree(const char* cmd); -+void printDiskStatFreeInfo(const char* cmd); -+void printDiskStatPercent(const char* cmd); -+void printDiskStatPercentInfo(const char* cmd); -+ -+#endif diff --git a/x11/kdebase4/files/patch-dm.c b/x11/kdebase4/files/patch-dm.c new file mode 100644 index 000000000000..3004d8e5f91a --- /dev/null +++ b/x11/kdebase4/files/patch-dm.c @@ -0,0 +1,19 @@ +--- ./kdm/backend/dm.c.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/backend/dm.c Thu Apr 18 20:53:44 2002 +@@ -236,7 +236,6 @@ + else + break; + } +- InitErrorLog (errorLogFile); + + /* + * Only allow root to run in non-debug mode to avoid problems +@@ -246,6 +245,8 @@ + fprintf (stderr, "Only root wants to run %s\n", prog); + exit (1); + } ++ ++ InitErrorLog (errorLogFile); + + /* + * Step 1 - load configuration parameters diff --git a/x11/kdebase4/files/patch-dm.h b/x11/kdebase4/files/patch-dm.h new file mode 100644 index 000000000000..f9f540e3486c --- /dev/null +++ b/x11/kdebase4/files/patch-dm.h @@ -0,0 +1,12 @@ +--- ./kdm/backend/dm.h.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/backend/dm.h Thu Apr 18 20:53:44 2002 +@@ -72,6 +72,9 @@ + # include <X11/Xdmcp.h> + #endif + ++#ifdef CSRG_BASED ++# include <sys/param.h> ++#endif + #ifdef pegasus + # undef dirty /* Some bozo put a macro called dirty in sys/param.h */ + #endif diff --git a/x11/kdebase4/files/patch-error.c b/x11/kdebase4/files/patch-error.c new file mode 100644 index 000000000000..4d2ace7334f8 --- /dev/null +++ b/x11/kdebase4/files/patch-error.c @@ -0,0 +1,60 @@ +--- ./kdm/backend/error.c.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/backend/error.c Thu Apr 18 20:53:44 2002 +@@ -43,6 +43,8 @@ + #include "dm.h" + #include "dm_error.h" + ++#include <sys/stat.h> ++#include <unistd.h> + #include <stdio.h> + + #define PRINT_QUOTES +@@ -91,6 +93,10 @@ + void + InitErrorLog (const char *errorLogFile) + { ++ int fd; ++ struct stat st; ++ char buf[128]; ++ + #ifdef USE_SYSLOG + # ifdef USE_PAM + ReInitErrorLog (); +@@ -101,15 +107,33 @@ + /* We do this independently of using syslog, as we cannot redirect + * the output of external programs to syslog. + */ +- if (isatty (2)) { +- char buf[100]; ++ if (errorLogFile ++ || fstat (1, &st) || ++#ifndef X_NOT_POSIX ++ !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode)) ++#else ++ !(st.st_mode & (S_IFREG | S_IFIFO)) ++#endif ++ || fstat (2, &st) || ++#ifndef X_NOT_POSIX ++ !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) ++#else ++ !(st.st_mode & (S_IFREG | S_IFIFO))) ++#endif ++ { + if (!errorLogFile) { + sprintf (buf, "/var/log/%s.log", prog); + errorLogFile = buf; + } +- if (!freopen (errorLogFile, "a", stderr)) ++ if ((fd = open (errorLogFile, O_CREAT | O_APPEND | O_WRONLY, 0666)) < 0) + LogError ("Cannot open log file %s\n", errorLogFile); ++ else { ++ if (fd != 1) { ++ dup2 (fd, 1); ++ close (fd); ++ } ++ dup2 (1, 2); ++ } + } +- dup2 (2, 1); + } + diff --git a/x11/kdebase4/files/patch-kdm-backend-Makefile.am b/x11/kdebase4/files/patch-kdm-backend-Makefile.am new file mode 100644 index 000000000000..cf370f25d126 --- /dev/null +++ b/x11/kdebase4/files/patch-kdm-backend-Makefile.am @@ -0,0 +1,12 @@ +--- ./kdm/backend/Makefile.am.orig Sun Sep 23 09:29:27 2001 ++++ ./kdm/backend/Makefile.am Thu Apr 18 20:53:44 2002 +@@ -1,6 +1,7 @@ +-INCLUDES = $(all_includes) $(KERBEROS_INCS) ++INCLUDES = $(X_INCLUDES) $(USER_INCLUDES) $(KERBEROS_INCS) ++CPPFLAGS = + AM_CFLAGS = $(XDM_CFLAGS) +-LDFLAGS = $(all_libraries) $(KDE_RPATH) $(KRB_RPATH) ++LDFLAGS = $(X_LDFLAGS) $(USER_LDFLAGS) $(KDE_RPATH) $(KRB_RPATH) + LDADD = $(LIB_X11) -lXau $(LIBXDMCP) $(PASSWDLIBS) \ + $(LIB_LIBS) $(KERBEROS_LIBS) $(LIBSOCKET) $(LIBRESOLV) \ + $(LIBUCB) $(LIBUTIL) diff --git a/x11/kdebase4/files/patch-kdm-backend-netaddr.c b/x11/kdebase4/files/patch-kdm-backend-netaddr.c new file mode 100644 index 000000000000..c0b18f485e00 --- /dev/null +++ b/x11/kdebase4/files/patch-kdm-backend-netaddr.c @@ -0,0 +1,33 @@ +--- ./kdm/backend/netaddr.c.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/backend/netaddr.c Thu Apr 18 20:53:44 2002 +@@ -216,11 +216,10 @@ + #ifdef DEBUG + /*ARGSUSED*/ + void +-PrintSockAddr (struct sockaddr *a, int len) ++PrintSockAddr (char *buf, struct sockaddr *a, int len) + { + unsigned char *t, *p; + +- Debug ("family %d, ", a->sa_family); + switch (a->sa_family) { + #ifdef AF_INET + case AF_INET: +@@ -228,11 +227,14 @@ + p = (unsigned char *) &((struct sockaddr_in *) a)->sin_port; + t = (unsigned char *) &((struct sockaddr_in *) a)->sin_addr; + +- Debug ("port %d, host %d.%d.%d.%d\n", +- (p[0] << 8) + p[1], t[0], t[1], t[2], t[3]); ++ sprintf (buf, "family AF_INET, port %d, host %d.%d.%d.%d", ++ (p[0] << 8) + p[1], t[0], t[1], t[2], t[3]); + break; +- } + #endif ++ default: ++ sprintf (buf, "unknown family %d", a->sa_family); ++ break; ++ } + } + #endif + diff --git a/x11/kdebase4/files/patch-kdm-backend-printf.c b/x11/kdebase4/files/patch-kdm-backend-printf.c new file mode 100644 index 000000000000..79033f3d7af3 --- /dev/null +++ b/x11/kdebase4/files/patch-kdm-backend-printf.c @@ -0,0 +1,126 @@ +--- ./kdm/backend/printf.c.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/backend/printf.c Thu Apr 18 20:53:44 2002 +@@ -65,7 +65,7 @@ + */ + + /************************************************************** +- * (C) 2001 Oswald Buddenhagen <ossi@kde.org> ++ * (C) 2001-2002 Oswald Buddenhagen <ossi@kde.org> + * Partially stolen from OpenSSH's OpenBSD compat directory. + * (C) Patrick Powell, Brandon Long, Thomas Roessler, + * Michael Elkins, Ben Lindstrom +@@ -507,23 +507,24 @@ + #ifdef USE_SYSLOG + syslog (LOG_CRIT, "Out of memory in %s()", fkt); + #else +- char dbuf[20]; ++ int el; ++ char dbuf[24], sbuf[128]; + logTime (dbuf); +- fprintf (stderr, "%s " ++ el = sprintf (sbuf, "%s " + # ifdef LOG_NAME + LOG_NAME "[%ld]: Out of memory in %s()\n", dbuf, + # else + "%s[%ld]: Out of memory in %s()\n", dbuf, prog, + # endif + (long)getpid(), fkt); +- fflush (stderr); ++ write (2, sbuf, el); + #endif + } + + typedef struct { + char *buf; + int clen, blen, type; +- char lmbuf[100]; ++ char lmbuf[128]; + } OCLBuf; + + static void +@@ -533,25 +534,11 @@ + #ifdef USE_SYSLOG + syslog (lognums[oclbp->type], "%.*s", oclbp->clen, oclbp->buf); + #else +- char dbuf[20]; +- logTime (dbuf); +- fprintf (stderr, "%s " +-# ifdef LOG_NAME +- LOG_NAME "[%ld] %s: %.*s\n", dbuf, +-# else +- "%s[%ld] %s: %.*s\n", dbuf, prog, +-# endif +- (long)getpid(), lognams[oclbp->type], oclbp->clen, oclbp->buf); +- fflush (stderr); ++ oclbp->buf[oclbp->clen] = '\n'; ++ write (2, oclbp->buf, oclbp->clen + 1); + #endif + oclbp->clen = 0; + } +- if (oclbp->buf) { +- if (oclbp->buf != oclbp->lmbuf) +- free (oclbp->buf); +- oclbp->buf = 0; +- oclbp->blen = 0; +- } + } + + static void +@@ -564,10 +551,17 @@ + if (c == '\n') + OutChLFlush (oclbp); + else { ++#ifndef USE_SYSLOG ++ if (oclbp->clen >= oclbp->blen - 1) { ++#else + if (oclbp->clen >= oclbp->blen) { +- if (oclbp->buf == oclbp->lmbuf) ++#endif ++ if (oclbp->buf == oclbp->lmbuf) { + OutChLFlush (oclbp); +- nlen = oclbp->blen * 3 / 2 + 100; ++ oclbp->buf = 0; ++ oclbp->blen = 0; ++ } ++ nlen = oclbp->blen * 3 / 2 + 128; + nbuf = realloc (oclbp->buf, nlen); + if (nbuf) { + oclbp->buf = nbuf; +@@ -579,6 +573,19 @@ + oclbp->blen = sizeof(oclbp->lmbuf); + } + } ++#ifndef USE_SYSLOG ++ if (!oclbp->clen) { ++ char dbuf[24]; ++ logTime (dbuf); ++ oclbp->clen = sprintf (oclbp->buf, "%s " ++# ifdef LOG_NAME ++ LOG_NAME "[%ld] %s: ", dbuf, ++# else ++ "%s[%ld] %s: ", dbuf, prog, ++# endif ++ (long)getpid(), lognams[oclbp->type]); ++ } ++#endif + oclbp->buf[oclbp->clen++] = c; + } + } +@@ -586,13 +593,12 @@ + static void + Logger (int type, const char *fmt, va_list args) + { +- static OCLBuf oclb; ++ OCLBuf oclb = { 0, 0, 0, type }; + +- if (oclb.type != type) { +- OutChLFlush (&oclb); +- oclb.type = type; +- } + DoPr(OutChL, &oclb, fmt, args); ++ /* no flush, every message is supposed to be \n-terminated */ ++ if (oclb.buf && oclb.buf != oclb.lmbuf) ++ free (oclb.buf); + } + + #ifdef LOG_DEBUG_MASK diff --git a/x11/kdebase4/files/patch-kdm-backend-protodpy.c b/x11/kdebase4/files/patch-kdm-backend-protodpy.c new file mode 100644 index 000000000000..0dee6a5c520d --- /dev/null +++ b/x11/kdebase4/files/patch-kdm-backend-protodpy.c @@ -0,0 +1,22 @@ +--- ./kdm/backend/protodpy.c.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/backend/protodpy.c Thu Apr 18 20:53:44 2002 +@@ -48,12 +48,13 @@ + PrintProtoDisplay (pdpy) + struct protoDisplay *pdpy; + { +- Debug ("ProtoDisplay %p\n", pdpy); +- Debug ("\taddress: "); +- PrintSockAddr (pdpy->address, pdpy->addrlen); +- Debug ("\tdate %d (%d from now)\n", pdpy->date, time(0) - pdpy->date); +- Debug ("\tdisplay Number %d\n", pdpy->displayNumber); +- Debug ("\tsessionID %d\n", pdpy->sessionID); ++ char addrbuf[128]; ++ ++ PrintSockAddr (addrbuf, pdpy->address, pdpy->addrlen); ++ Debug ("ProtoDisplay %p\n\taddress: %s\n\tdate %d (%d from now)\n" ++ "\tdisplay Number %d\n\tsessionID %d\n", ++ pdpy, addrbuf, pdpy->date, time(0) - pdpy->date, ++ pdpy->displayNumber, pdpy->sessionID); + } + #endif + diff --git a/x11/kdebase4/files/patch-kdm-backend-xdmcp.c b/x11/kdebase4/files/patch-kdm-backend-xdmcp.c new file mode 100644 index 000000000000..ab365e01bd60 --- /dev/null +++ b/x11/kdebase4/files/patch-kdm-backend-xdmcp.c @@ -0,0 +1,24 @@ +--- ./kdm/backend/xdmcp.c.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/backend/xdmcp.c Thu Apr 18 20:53:44 2002 +@@ -510,10 +510,8 @@ + j = 0; + for (i = 0; i < (int)clientPort.length; i++) + j = j * 256 + clientPort.data[i]; +- Debug ("Forward client address (port %d)", j); +- for (i = 0; i < (int)clientAddress.length; i++) +- Debug (" %d", clientAddress.data[i]); +- Debug ("\n"); ++ Debug ("Forward client address (port %d) %[*hhu\n", j, ++ clientAddress.length, clientAddress.data); + switch (from->sa_family) + { + #ifdef AF_INET +@@ -1014,7 +1012,7 @@ + + sprintf (buf, "Session %ld failed for display %.260s: %s", + (long) sessionID, name, reason); +- Debug ("send_failed(\"%s\")", buf); ++ Debug ("send_failed(%\"s)\n", buf); + status.length = strlen (buf); + status.data = (CARD8Ptr) buf; + header.version = XDM_PROTOCOL_VERSION; diff --git a/x11/kdebase4/files/patch-kdm-configure.in.in b/x11/kdebase4/files/patch-kdm-configure.in.in new file mode 100644 index 000000000000..2523cd5e64d3 --- /dev/null +++ b/x11/kdebase4/files/patch-kdm-configure.in.in @@ -0,0 +1,20 @@ +--- ./kdm/configure.in.in.orig Sun Mar 24 12:31:09 2002 ++++ ./kdm/configure.in.in Thu Apr 18 20:53:44 2002 +@@ -220,8 +220,6 @@ + [ AC_MSG_ERROR([--with-rpcauth requires Sun RPC header files.])]) + fi + +-if test "x$use_pam" = xno; then +- + dnl should be: + dnl AC_CHECK_MEMBER(struct passwd.pw_expire, [ XDM_CFLAGS="$XDM_CFLAGS -DHAVE_PW_EXPIRE" ], , [#include <pwd.h>]) + dnl but somehow it doesn't work. so we make it by hand ... +@@ -245,8 +243,6 @@ + AC_CHECK_FUNC(login_getclass, [ XDM_CFLAGS="$XDM_CFLAGS -DHAVE_LOGIN_GETCLASS" ]) + AC_CHECK_FUNC(auth_timeok, [ XDM_CFLAGS="$XDM_CFLAGS -DHAVE_AUTH_TIMEOK" ]) + LIBS=$ac_save_libs +- +-fi + + AC_CHECK_FUNC(vsyslog, [ XDM_CFLAGS="$XDM_CFLAGS -DUSE_SYSLOG" ]) + if test "x$use_pam" = xyes; then diff --git a/x11/kdebase4/files/patch-kdm-kfrontend-genkdmconf.c b/x11/kdebase4/files/patch-kdm-kfrontend-genkdmconf.c new file mode 100644 index 000000000000..5f6252b5266c --- /dev/null +++ b/x11/kdebase4/files/patch-kdm-kfrontend-genkdmconf.c @@ -0,0 +1,107 @@ +--- ./kdm/kfrontend/genkdmconf.c.orig Thu Mar 21 21:11:30 2002 ++++ ./kdm/kfrontend/genkdmconf.c Thu Apr 18 21:22:40 2002 +@@ -37,6 +37,10 @@ + #include <ctype.h> + #include <stdarg.h> + #include <fcntl.h> ++#include <sys/param.h> ++#ifdef BSD ++# include <utmp.h> ++#endif + + #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) + # define ATTR_UNUSED __attribute__((unused)) +@@ -358,11 +362,11 @@ + + const char def_willing[] = + "#! /bin/sh\n" +-"# The output of this script is displayed in the chooser window.\n" +-"# (instead of \"Willing to manage\")\n" ++"# The output of this script is displayed in the chooser window\n" ++"# (instead of \"Willing to manage\").\n" + "\n" +-"load=\"`uptime|sed -e 's/^.*load[^0-9]*//'`\"\n" +-"nrusers=\"`who|cut -c 1-8|sort -u|wc -l|sed 's/^[ ]*//'`\"\n" ++"load=`uptime|sed -e 's/^.*load[^0-9]*//'`\n" ++"nrusers=`who|cut -c 1-8|sort -u|wc -l|sed 's/^[ ]*//'`\n" + "s=\"\"; [ \"$nrusers\" != 1 ] && s=s\n" + "\n" + "echo \"${nrusers} user${s}, load: ${load}\"\n"; +@@ -377,7 +381,10 @@ + " echo $! >$PIDFILE\n" + " wait $!\n" + " rm $PIDFILE\n" +-") &\n"; ++") &\n" ++"\n" ++"#xconsole -geometry 480x130-0-0 -notify -verbose -fn fixed -exitOnFail -file /dev/xconsole &\n" ++"\n"; + + const char def_startup[] = + "#! /bin/sh\n" +@@ -391,14 +398,11 @@ + "# By convention, both xconsole and xterm -C check that the\n" + "# console is owned by the invoking user and is readable before attaching\n" + "# the console output. This way a random user can invoke xterm -C without\n" +-"# causing serious grief.\n" +-"# This is not required if you use PAM, as pam_console should handle it.\n" ++"# causing serious grief; still, it can cause havoc, so xconsole is started\n" ++"# by Xsetup usually.\n" ++"# This is not required if you use PAM with the pam_console module.\n" + "#\n" +-#ifdef HAVE_PAM + "#chown $USER /dev/console\n" +-#else +-"chown $USER /dev/console\n" +-#endif + "\n" + #ifdef _AIX + "# We create a pseudodevice for finger. (host:0 becomes kdm/host_0)\n" +@@ -425,11 +429,11 @@ + " fi\n" + "fi\n"; + #else +-"#exec sessreg -a -l $DISPLAY " ++"exec sessreg -a -l $DISPLAY" + # ifdef BSD +-"-x " KDMCONF "/Xservers " ++" -x " KDMCONF "/Xservers -u " _PATH_UTMP + # endif +-"$USER\n"; ++" $USER\n"; + #endif /* _AIX */ + + const char def_reset[] = +@@ -437,16 +441,10 @@ + "# Xreset - run as root after session exits\n" + "\n" + "# Reassign ownership of the console to root, this should disallow\n" +-"# assignment of console output to any random users's xterm\n" +-"# This is not required if you use PAM, as pam_console should handle it.\n" ++"# assignment of console output to any random users's xterm. See Xstartup.\n" + "#\n" +-#ifdef HAVE_PAM + "#chown root /dev/console\n" + "#chmod 622 /dev/console\n" +-#else +-"chown root /dev/console\n" +-"chmod 622 /dev/console\n" +-#endif + "\n" + #ifdef _AIX + "if [ -f /usr/lib/X11/xdm/sessreg ]; then\n" +@@ -454,11 +452,11 @@ + " exec /usr/lib/X11/xdm/sessreg -d -l xdm/$devname $USER\n" + "fi\n"; + #else +-"#exec sessreg -d -l $DISPLAY " ++"exec sessreg -d -l $DISPLAY" + # ifdef BSD +-"-x " KDMCONF "/Xservers " ++" -x " KDMCONF "/Xservers -u " _PATH_UTMP + # endif +-"$USER\n"; ++" $USER\n"; + #endif /* _AIX */ + + const char def_session[] = diff --git a/x11/kdebase4/files/patch-kdm::kfrontend::Makefile.am b/x11/kdebase4/files/patch-kdm::kfrontend::Makefile.am deleted file mode 100644 index c5274c1096ac..000000000000 --- a/x11/kdebase4/files/patch-kdm::kfrontend::Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ ---- kdm/kfrontend/Makefile.am.~1.21.~ Sun Jul 29 00:56:28 2001 -+++ kdm/kfrontend/Makefile.am Mon Dec 10 01:08:15 2001 -@@ -25,10 +25,8 @@ - genkdmconf_LDADD = $(LIB_X11) - - install-data-local: -- @if test ! -d $(DESTDIR)$(kde_confdir)/kdm; then \ -- $(mkinstalldirs) $(DESTDIR)$(kde_confdir)/kdm; \ -- ./genkdmconf --in $(DESTDIR)$(kde_confdir)/kdm; \ -- fi -+ -$(mkinstalldirs) $(DESTDIR)$(kde_confdir)/kdm -+ ./genkdmconf --no-old --in $(DESTDIR)$(kde_confdir)/kdm - - messages: - $(XGETTEXT) $(kdm_greet_SOURCES) -o $(podir)/kdmgreet.pot diff --git a/x11/kdebase4/files/patch-kdm::kfrontend::genkdmconf.c b/x11/kdebase4/files/patch-kdm::kfrontend::genkdmconf.c deleted file mode 100644 index 2c852c344aac..000000000000 --- a/x11/kdebase4/files/patch-kdm::kfrontend::genkdmconf.c +++ /dev/null @@ -1,52 +0,0 @@ ---- kdm/kfrontend/genkdmconf.c.orig Mon Nov 5 21:40:03 2001 -+++ kdm/kfrontend/genkdmconf.c Fri Feb 22 19:34:28 2002 -@@ -212,7 +212,7 @@ - */ - - #ifndef HALT_CMD --# ifdef BSD -+# if defined(BSD) || defined(__FreeBSD__) - # define HALT_CMD "/sbin/shutdown -h now" - # define REBOOT_CMD "/sbin/shutdown -r now" - # elif defined(__SVR4) -@@ -1605,8 +1605,8 @@ - "chown $USER /dev/console\n" - #endif - "\n" --"#exec sessreg -a -l $DISPLAY " --#ifdef BSD -+"exec sessreg -a -l $DISPLAY " -+#if defined(BSD) || defined(__FreeBSD__) - "-x " KDMCONF "/Xservers " - #endif - "$USER\n" -@@ -1627,8 +1627,8 @@ - "chmod 622 /dev/console\n" - #endif - "\n" --"#exec sessreg -d -l $DISPLAY " --#ifdef BSD -+"exec sessreg -d -l $DISPLAY " -+#if defined(BSD) || defined(__FreeBSD__) - "-x " KDMCONF "/Xservers " - #endif - "$USER\n" -@@ -1658,7 +1658,8 @@ - " exec xterm -geometry 80x24-0-0 $*\n" - " ;;\n" - " \"\"|default)\n" --" exec $HOME/.xsession $*\n" -+" test -x $HOME/.xsession && exec $HOME/.xsession $*\n" -+" sess=kde\n" - " ;;\n" - "esac\n" - "\n" -@@ -1781,7 +1782,7 @@ - } - addKdePath ("UserPath", DEF_USER_PATH); - addKdePath ("SystemPath", DEF_SYSTEM_PATH); -- ASPrintf (&newkdmrc, "%s/kdmrc", newdir); -+ ASPrintf (&newkdmrc, "%s/kdmrc.dist", newdir); - f = Create (newkdmrc, kdmrcmode); - wrconf (f); - fclose (f); diff --git a/x11/kdebase4/files/patch-ksysguardd.c b/x11/kdebase4/files/patch-ksysguardd.c deleted file mode 100644 index e7a37616b367..000000000000 --- a/x11/kdebase4/files/patch-ksysguardd.c +++ /dev/null @@ -1,11 +0,0 @@ ---- ksysguard/ksysguardd/FreeBSD/ksysguardd.c.orig Sat Nov 10 00:17:04 2001 -+++ ksysguard/ksysguardd/FreeBSD/ksysguardd.c Sun Dec 9 22:26:48 2001 -@@ -37,6 +37,8 @@ - #include <sys/wait.h> - #include <unistd.h> - -+#include "config.h" -+ - #include "CPU.h" - #include "Command.h" - #include "Memory.h" diff --git a/x11/kdebase4/files/patch-ksysguardd.h b/x11/kdebase4/files/patch-ksysguardd.h deleted file mode 100644 index 1545b83d39d7..000000000000 --- a/x11/kdebase4/files/patch-ksysguardd.h +++ /dev/null @@ -1,37 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/ksysguardd.h Mon Nov 19 17:07:38 2001 -@@ -0,0 +1,34 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 1999-2001 Chris Schlaeger <cs@kde.org> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: ksysguardd.h,v 1.2 2001/11/08 10:52:55 tokoe Exp $ -+*/ -+ -+#ifndef _ksysguardd_h_ -+#define _ksysguardd_h_ -+ -+#include <stdio.h> -+ -+extern int QuitApp; -+extern int RunAsDaemon; -+extern FILE* CurrentClient; -+ -+void updateModules(void); -+void checkModules(void); -+ -+#endif diff --git a/x11/kdebase4/files/patch-loadavg.c b/x11/kdebase4/files/patch-loadavg.c deleted file mode 100644 index ced78fa5ad68..000000000000 --- a/x11/kdebase4/files/patch-loadavg.c +++ /dev/null @@ -1,100 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/loadavg.c Mon Nov 19 17:07:47 2001 -@@ -0,0 +1,97 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: loadavg.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#include <stdio.h> -+#include <stdlib.h> -+ -+#include "Command.h" -+#include "ksysguardd.h" -+#include "loadavg.h" -+ -+static double LoadAvg[3]; -+ -+/* -+================================ public part ================================= -+*/ -+ -+void -+initLoadAvg(void) -+{ -+ if (updateLoadAvg() < 0) -+ return; -+ -+ registerMonitor("cpu/loadavg1", "float", printLoadAvg1, -+ printLoadAvg1Info); -+ registerMonitor("cpu/loadavg5", "float", printLoadAvg5, -+ printLoadAvg5Info); -+ registerMonitor("cpu/loadavg15", "float", printLoadAvg15, -+ printLoadAvg15Info); -+} -+ -+void -+exitLoadAvg(void) -+{ -+ removeMonitor("cpu/loadavg1"); -+ removeMonitor("cpu/loadavg5"); -+ removeMonitor("cpu/loadavg15"); -+} -+ -+int -+updateLoadAvg(void) -+{ -+ return getloadavg(LoadAvg, 3); -+} -+ -+void -+printLoadAvg1(const char* c) -+{ -+ fprintf(CurrentClient, "%f\n", LoadAvg[0]); -+} -+ -+void -+printLoadAvg1Info(const char* c) -+{ -+ fprintf(CurrentClient, "Load average 1 min\t0\t0\t\n"); -+} -+ -+void -+printLoadAvg5(const char* c) -+{ -+ fprintf(CurrentClient, "%f\n", LoadAvg[1]); -+} -+ -+void -+printLoadAvg5Info(const char* c) -+{ -+ fprintf(CurrentClient, "Load average 5 min\t0\t0\t\n"); -+} -+ -+void -+printLoadAvg15(const char* c) -+{ -+ fprintf(CurrentClient, "%f\n", LoadAvg[2]); -+} -+ -+void -+printLoadAvg15Info(const char* c) -+{ -+ fprintf(CurrentClient, "Load average 15 min\t0\t0\t\n"); -+} diff --git a/x11/kdebase4/files/patch-loadavg.h b/x11/kdebase4/files/patch-loadavg.h deleted file mode 100644 index cdc680cbd492..000000000000 --- a/x11/kdebase4/files/patch-loadavg.h +++ /dev/null @@ -1,39 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/loadavg.h Mon Nov 19 17:07:47 2001 -@@ -0,0 +1,36 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: loadavg.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#ifndef _loadavg_h_ -+#define _loadavg_h_ -+ -+void initLoadAvg(void); -+void exitLoadAvg(void); -+int updateLoadAvg(void); -+ -+void printLoadAvg1(const char*); -+void printLoadAvg1Info(const char*); -+void printLoadAvg5(const char*); -+void printLoadAvg5Info(const char*); -+void printLoadAvg15(const char*); -+void printLoadAvg15Info(const char*); -+ -+#endif diff --git a/x11/kdebase4/files/patch-logfile.c b/x11/kdebase4/files/patch-logfile.c deleted file mode 100644 index 5fd3def1ae6b..000000000000 --- a/x11/kdebase4/files/patch-logfile.c +++ /dev/null @@ -1,184 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/logfile.c Mon Nov 19 17:07:55 2001 -@@ -0,0 +1,181 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: logfile.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+ -+#include "Command.h" -+#include "ccont.h" -+#include "conf.h" -+#include "ksysguardd.h" -+#include "logfile.h" -+ -+static CONTAINER LogFiles = 0; -+static unsigned long counter = 1; -+ -+typedef struct { -+ char name[256]; -+ FILE* fh; -+ unsigned long id; -+} LogFileEntry; -+ -+extern CONTAINER LogFileList; -+ -+/* -+================================ public part ================================= -+*/ -+ -+void initLogFile(void) -+{ -+ int i; -+ char monitor[1024]; -+ -+ registerCommand("logfile_register", registerLogFile); -+ registerCommand("logfile_unregister", unregisterLogFile); -+ registerCommand("logfile_registered", printRegistered); -+ -+ for (i = 0; i < level_ctnr(LogFileList); i++) -+ { -+ FILE* fp; -+ ConfigLogFile *entry = get_ctnr(LogFileList, i); -+ /* register the log file if we can actually read the file. */ -+ if ((fp = fopen(entry->path, "r")) != NULL) -+ { -+ fclose(fp); -+ snprintf(monitor, 1024, "logfiles/%s", entry->name); -+ registerMonitor(monitor, "logfile", printLogFile, -+ printLogFileInfo); -+ } -+ } -+ -+ LogFiles = new_ctnr(CT_DLL); -+} -+ -+void exitLogFile(void) -+{ -+ if (LogFiles) -+ destr_ctnr(LogFiles, free); -+} -+ -+void printLogFile(const char* cmd) -+{ -+ char line[1024]; -+ unsigned long id; -+ int i; -+ char ch; -+ -+ sscanf(cmd, "%*s %lu", &id); -+ -+ for (i = 0; i < level_ctnr(LogFiles); i++) { -+ LogFileEntry *entry = get_ctnr(LogFiles, i); -+ -+ if (entry->id == id) { -+ while (fgets(line, sizeof(line), entry->fh) != NULL) { -+ fprintf(CurrentClient, "%s", line); -+ } -+ clearerr(entry->fh); -+ } -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} -+ -+void printLogFileInfo(const char* cmd) -+{ -+ fprintf(CurrentClient, "LogFile\n"); -+} -+ -+void registerLogFile(const char* cmd) -+{ -+ char name[256]; -+ FILE* file; -+ LogFileEntry *entry; -+ int i; -+ -+ memset(name, 0, sizeof(name)); -+ sscanf(cmd, "%*s %256s", name); -+ -+ for (i = 0; i < level_ctnr(LogFileList); i++) { -+ ConfigLogFile *conf = get_ctnr(LogFileList, i); -+ if (!strcmp(conf->name, name)) { -+ if ((file = fopen(conf->path, "r")) == NULL) { -+ print_error("fopen()"); -+ fprintf(CurrentClient, "0\n"); -+ return; -+ } -+ -+ fseek(file, 0, SEEK_END); -+ -+ if ((entry = (LogFileEntry *)malloc(sizeof(LogFileEntry))) == NULL) { -+ print_error("malloc()"); -+ fprintf(CurrentClient, "0\n"); -+ return; -+ } -+ -+ entry->fh = file; -+ strncpy(entry->name, conf->name, 256); -+ entry->id = counter; -+ -+ push_ctnr(LogFiles, entry); -+ -+ fprintf(CurrentClient, "%lu\n", counter); -+ counter++; -+ -+ return; -+ } -+ } -+ -+ fprintf(CurrentClient, "0\n"); -+} -+ -+void unregisterLogFile(const char* cmd) -+{ -+ unsigned long id; -+ int i; -+ -+ sscanf(cmd, "%*s %lu", &id); -+ -+ for (i = 0; i < level_ctnr(LogFiles); i++) { -+ LogFileEntry *entry = get_ctnr(LogFiles, i); -+ -+ if (entry->id == id) { -+ fclose(entry->fh); -+ free(remove_ctnr(LogFiles, i)); -+ fprintf(CurrentClient, "\n"); -+ return; -+ } -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} -+ -+void printRegistered(const char* cmd) -+{ -+ int i; -+ -+ for (i = 0; i < level_ctnr(LogFiles); i++) { -+ LogFileEntry *entry = get_ctnr(LogFiles, i); -+ fprintf(CurrentClient, "%s:%lu\n", entry->name, entry->id); -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} diff --git a/x11/kdebase4/files/patch-logfile.h b/x11/kdebase4/files/patch-logfile.h deleted file mode 100644 index 69b8d6ed1ca6..000000000000 --- a/x11/kdebase4/files/patch-logfile.h +++ /dev/null @@ -1,40 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/logfile.h Mon Nov 19 17:07:55 2001 -@@ -0,0 +1,37 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: logfile.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#ifndef _logfile_h_ -+#define _logfile_h_ -+ -+void initLogFile(void); -+void exitLogFile(void); -+ -+void printLogFile(const char* cmd); -+void printLogFileInfo(const char* cmd); -+ -+void registerLogFile(const char* cmd); -+void unregisterLogFile(const char* cmd); -+ -+/* debug command */ -+void printRegistered(const char* cmd); -+ -+#endif diff --git a/x11/kdebase4/files/patch-netdev.c b/x11/kdebase4/files/patch-netdev.c deleted file mode 100644 index 2c0f473ebbcf..000000000000 --- a/x11/kdebase4/files/patch-netdev.c +++ /dev/null @@ -1,322 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/netdev.c Mon Nov 19 17:08:04 2001 -@@ -0,0 +1,319 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: netdev.c,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#include <fcntl.h> -+#include <sys/socket.h> -+#include <net/if.h> -+#include <net/if_mib.h> -+#include <stdio.h> -+#include <string.h> -+#include <sys/sysctl.h> -+#include <sys/time.h> -+#include <sys/types.h> -+#include <unistd.h> -+ -+ -+#include "Command.h" -+#include "ksysguardd.h" -+#include "netdev.h" -+ -+ -+typedef struct { -+ char name[32]; -+ u_long recBytes; -+ u_long recPacks; -+ u_long recErrs; -+ u_long recDrop; -+ u_long recMulticast; -+ u_long sentBytes; -+ u_long sentPacks; -+ u_long sentErrs; -+ u_long sentMulticast; -+ u_long sentColls; -+} NetDevInfo; -+ -+#define MAXNETDEVS 64 -+static NetDevInfo NetDevs[MAXNETDEVS]; -+static int NetDevCnt = 0; -+ -+char **parseCommand(const char *cmd) -+{ -+ char tmp_cmd[1024]; -+ char *begin; -+ static char sensor[100]; -+ static char interface[100]; -+ static char* retval[2]; -+ -+ strncpy(tmp_cmd, cmd, 1024); -+ -+ begin = rindex(tmp_cmd, '/'); -+ *begin = '\0'; -+ begin++; -+ strcpy(sensor, begin); -+ retval[1] = sensor; -+ -+ begin = rindex(tmp_cmd, '/'); -+ *begin = '\0'; -+ begin = rindex(tmp_cmd, '/'); -+ begin++; -+ strcpy(interface, begin); -+ retval[0] = interface; -+ -+ return retval; -+} -+ -+int numActivIfaces(void) -+{ -+ int counter = 0; -+ int name[6]; -+ int num_iface, i; -+ size_t len; -+ struct ifmibdata ifmd; -+ -+ len = sizeof(num_iface); -+ sysctlbyname("net.link.generic.system.ifcount", &num_iface, &len, NULL, 0); -+ -+ for (i = 1; i < num_iface + 1; i++) { -+ name[0] = CTL_NET; -+ name[1] = PF_LINK; -+ name[2] = NETLINK_GENERIC; -+ name[3] = IFMIB_IFDATA; -+ name[4] = i; -+ name[5] = IFDATA_GENERAL; -+ -+ len = sizeof(ifmd); -+ sysctl(name, 6, &ifmd, &len, NULL, 0); -+ if (ifmd.ifmd_flags & IFF_UP) -+ counter++; -+ } -+ -+ return counter; -+} -+ -+/* ------------------------------ public part --------------------------- */ -+ -+void initNetDev(void) -+{ -+ int i; -+ char monitor[1024]; -+ -+ updateNetDev(); -+ -+ for (i = 0; i < NetDevCnt; i++) { -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/data", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/packets", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/errors", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/drops", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/multicast", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevRecBytes, printNetDevRecBytesInfo); -+ -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/data", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/packets", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/errors", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/multicast", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/collisions", NetDevs[i].name); -+ registerMonitor(monitor, "integer", printNetDevSentBytes, printNetDevSentBytesInfo); -+ } -+} -+ -+void exitNetDev(void) -+{ -+ int i; -+ char monitor[1024]; -+ -+ for (i = 0; i < NetDevCnt; i++) { -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/data", NetDevs[i].name); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/packets", NetDevs[i].name); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/errors", NetDevs[i].name); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/drops", NetDevs[i].name); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/receiver/multicast", NetDevs[i].name); -+ removeMonitor(monitor); -+ -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/data", NetDevs[i].name); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/packets", NetDevs[i].name); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/errors", NetDevs[i].name); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/multicast", NetDevs[i].name); -+ removeMonitor(monitor); -+ snprintf(monitor, sizeof(monitor), "network/interfaces/%s/transmitter/collisions", NetDevs[i].name); -+ removeMonitor(monitor); -+ } -+} -+ -+void updateNetDev(void) -+{ -+ int name[6]; -+ int num_iface, i; -+ size_t len; -+ struct ifmibdata ifmd; -+ -+ len = sizeof(num_iface); -+ sysctlbyname("net.link.generic.system.ifcount", &num_iface, &len, NULL, 0); -+ -+ NetDevCnt = 0; -+ for (i = 1; i < num_iface + 1; i++) { -+ name[0] = CTL_NET; -+ name[1] = PF_LINK; -+ name[2] = NETLINK_GENERIC; -+ name[3] = IFMIB_IFDATA; -+ name[4] = i; -+ name[5] = IFDATA_GENERAL; -+ -+ len = sizeof(ifmd); -+ sysctl(name, 6, &ifmd, &len, NULL, 0); -+ if (ifmd.ifmd_flags & IFF_UP) { -+ strncpy(NetDevs[NetDevCnt].name, ifmd.ifmd_name, 32); -+ NetDevs[NetDevCnt].recBytes = ifmd.ifmd_data.ifi_ibytes - NetDevs[NetDevCnt].recBytes; -+ NetDevs[NetDevCnt].recPacks = ifmd.ifmd_data.ifi_ipackets - NetDevs[NetDevCnt].recPacks; -+ NetDevs[NetDevCnt].recErrs = ifmd.ifmd_data.ifi_ierrors - NetDevs[NetDevCnt].recErrs; -+ NetDevs[NetDevCnt].recDrop = ifmd.ifmd_data.ifi_iqdrops - NetDevs[NetDevCnt].recDrop; -+ NetDevs[NetDevCnt].recMulticast = ifmd.ifmd_data.ifi_imcasts - NetDevs[NetDevCnt].recMulticast; -+ NetDevs[NetDevCnt].sentBytes = ifmd.ifmd_data.ifi_obytes - NetDevs[NetDevCnt].sentBytes; -+ NetDevs[NetDevCnt].sentPacks = ifmd.ifmd_data.ifi_opackets - NetDevs[NetDevCnt].sentPacks; -+ NetDevs[NetDevCnt].sentErrs = ifmd.ifmd_data.ifi_oerrors - NetDevs[NetDevCnt].sentErrs; -+ NetDevs[NetDevCnt].sentMulticast = ifmd.ifmd_data.ifi_omcasts - NetDevs[NetDevCnt].sentMulticast; -+ NetDevs[NetDevCnt].sentColls = ifmd.ifmd_data.ifi_collisions - NetDevs[NetDevCnt].sentColls; -+ NetDevCnt++; -+ } -+ } -+} -+ -+void checkNetDev(void) -+{ -+ if (numActivIfaces() != NetDevCnt) { -+ /* interface has been added or removed -+ so we do a reset */ -+ exitNetDev(); -+ initNetDev(); -+ } -+} -+ -+void printNetDevRecBytes(const char *cmd) -+{ -+ int i; -+ char **retval; -+ -+ retval = parseCommand(cmd); -+ -+ if (retval[0] == NULL || retval[1] == NULL) -+ return; -+ -+ for (i = 0; i < NetDevCnt; i++) { -+ if (!strcmp(NetDevs[i].name, retval[0])) { -+ if (!strncmp(retval[1], "data", 4)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].recBytes); -+ if (!strncmp(retval[1], "packets", 7)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].recPacks); -+ if (!strncmp(retval[1], "errors", 6)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].recErrs); -+ if (!strncmp(retval[1], "drops", 5)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].recDrop); -+ if (!strncmp(retval[1], "multicast", 9)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].recMulticast); -+ } -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} -+ -+void printNetDevRecBytesInfo(const char *cmd) -+{ -+ char **retval; -+ -+ retval = parseCommand(cmd); -+ -+ if (retval[1] == NULL) -+ return; -+ -+ if (!strncmp(retval[1], "data", 4)) -+ fprintf(CurrentClient, "Received Data\t0\t0\tkBytes/s\n"); -+ if (!strncmp(retval[1], "packets", 7)) -+ fprintf(CurrentClient, "Received Packets\t0\t0\t1/s\n"); -+ if (!strncmp(retval[1], "errors", 6)) -+ fprintf(CurrentClient, "Receiver Errors\t0\t0\t1/s\n"); -+ if (!strncmp(retval[1], "drops", 5)) -+ fprintf(CurrentClient, "Receiver Drops\t0\t0\t1/s\n"); -+ if (!strncmp(retval[1], "multicast", 9)) -+ fprintf(CurrentClient, "Received Multicast Packets\t0\t0\t1/s\n"); -+} -+ -+void printNetDevSentBytes(const char *cmd) -+{ -+ int i; -+ char **retval; -+ -+ retval = parseCommand(cmd); -+ -+ if (retval[0] == NULL || retval[1] == NULL) -+ return; -+ -+ for (i = 0; i < NetDevCnt; i++) { -+ if (!strcmp(NetDevs[i].name, retval[0])) { -+ if (!strncmp(retval[1], "data", 4)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].sentBytes); -+ if (!strncmp(retval[1], "packets", 7)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].sentPacks); -+ if (!strncmp(retval[1], "errors", 6)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].sentErrs); -+ if (!strncmp(retval[1], "multicast", 9)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].sentMulticast); -+ if (!strncmp(retval[1], "collisions", 10)) -+ fprintf(CurrentClient, "%lu", NetDevs[i].sentColls); -+ } -+ } -+ -+ fprintf(CurrentClient, "\n"); -+} -+ -+void printNetDevSentBytesInfo(const char *cmd) -+{ -+ char **retval; -+ -+ retval = parseCommand(cmd); -+ -+ if (retval[1] == NULL) -+ return; -+ -+ if (!strncmp(retval[1], "data", 4)) -+ fprintf(CurrentClient, "Sent Data\t0\t0\tkBytes/s\n"); -+ if (!strncmp(retval[1], "packets", 7)) -+ fprintf(CurrentClient, "Sent Packets\t0\t0\t1/s\n"); -+ if (!strncmp(retval[1], "errors", 6)) -+ fprintf(CurrentClient, "Transmitter Errors\t0\t0\t1/s\n"); -+ if (!strncmp(retval[1], "multicast", 9)) -+ fprintf(CurrentClient, "Sent Multicast Packets\t0\t0\t1/s\n"); -+ if (!strncmp(retval[1], "collisions", 10)) -+ fprintf(CurrentClient, "Transmitter Collisions\t0\t0\t1/s\n"); -+} diff --git a/x11/kdebase4/files/patch-netdev.h b/x11/kdebase4/files/patch-netdev.h deleted file mode 100644 index 3c291f85dc9e..000000000000 --- a/x11/kdebase4/files/patch-netdev.h +++ /dev/null @@ -1,39 +0,0 @@ ---- /dev/null Mon Nov 19 17:14:17 2001 -+++ ksysguard/ksysguardd/FreeBSD/netdev.h Mon Nov 19 17:08:04 2001 -@@ -0,0 +1,36 @@ -+/* -+ KSysGuard, the KDE System Guard -+ -+ Copyright (c) 2001 Tobias Koenig <tokoe82@yahoo.de> -+ -+ This program is free software; you can redistribute it and/or -+ modify it under the terms of version 2 of the GNU General Public -+ License as published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ -+ $Id: netdev.h,v 1.2 2001/09/18 14:03:53 tokoe Exp $ -+*/ -+ -+#ifndef _netdev_h_ -+#define _netdev_h_ -+ -+void initNetDev(void); -+void exitNetDev(void); -+ -+void updateNetDev(void); -+void checkNetDev(void); -+ -+void printNetDevRecBytes(const char* cmd); -+void printNetDevRecBytesInfo(const char* cmd); -+void printNetDevSentBytes(const char* cmd); -+void printNetDevSentBytesInfo(const char* cmd); -+ -+#endif |