Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 60625 Details for
Bug 94909
sys-process/procps: support setting sysfs values automatically at boot time using an initscript
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
procps-3.2.5-sysfsctl.patch
procps-3.2.5-sysfsctl.patch (text/plain), 4.15 KB, created by
SpanKY
on 2005-06-05 01:56:36 UTC
(
hide
)
Description:
procps-3.2.5-sysfsctl.patch
Filename:
MIME Type:
Creator:
SpanKY
Created:
2005-06-05 01:56:36 UTC
Size:
4.15 KB
patch
obsolete
>Index: sysctl.c >=================================================================== >RCS file: /cvsroot/procps/procps/sysctl.c,v >retrieving revision 1.14 >diff -u -U1 -r1.14 sysctl.c >--- sysctl.c >+++ sysctl.c >@@ -46,3 +46,6 @@ > static const char PROC_PATH[] = "/proc/sys/"; >+static const char SYSFS_PATH[] = "/sys/"; >+static const char *dst_path; > static const char DEFAULT_PRELOAD[] = "/etc/sysctl.conf"; >+static const char DEFAULT_SYSFS_PRELOAD[] = "/etc/sysfsctl.conf"; > static bool NameOnly; >@@ -84,3 +87,3 @@ > */ >-static int Usage(const char *restrict const name) { >+static int Usage(const char *restrict const name, const char *config) { > printf("usage: %s [-n] [-e] variable ... \n" >@@ -88,4 +91,4 @@ > " %s [-n] [-e] -a \n" >- " %s [-n] [-e] [-q] -p <file> (default /etc/sysctl.conf) \n" >- " %s [-n] [-e] -A\n", name, name, name, name, name); >+ " %s [-n] [-e] [-q] -p <file> (default %s) \n" >+ " %s [-n] [-e] -A\n", name, name, name, name, config, name); > return -1; >@@ -137,6 +140,6 @@ > /* used to open the file */ >- tmpname = malloc(strlen(name)+strlen(PROC_PATH)+1); >- strcpy(tmpname, PROC_PATH); >+ tmpname = malloc(strlen(name)+strlen(dst_path)+1); >+ strcpy(tmpname, dst_path); > strcat(tmpname, name); >- slashdot(tmpname+strlen(PROC_PATH),'.','/'); /* change . to / */ >+ slashdot(tmpname+strlen(dst_path),'.','/'); /* change . to / */ > >@@ -246,3 +249,3 @@ > } else { >- rc |= ReadSetting(tmpdir+strlen(PROC_PATH)); >+ rc |= ReadSetting(tmpdir+strlen(dst_path)); > } >@@ -289,7 +292,7 @@ > /* used to open the file */ >- tmpname = malloc(equals-name+1+strlen(PROC_PATH)); >- strcpy(tmpname, PROC_PATH); >+ tmpname = malloc(equals-name+1+strlen(dst_path)); >+ strcpy(tmpname, dst_path); > strncat(tmpname, name, (int)(equals-name)); >- tmpname[equals-name+strlen(PROC_PATH)] = 0; >- slashdot(tmpname+strlen(PROC_PATH),'.','/'); /* change . to / */ >+ tmpname[equals-name+strlen(dst_path)] = 0; >+ slashdot(tmpname+strlen(dst_path),'.','/'); /* change . to / */ > >@@ -419,3 +422,3 @@ > int ReturnCode = 0; >- const char *preloadfile = DEFAULT_PRELOAD; >+ const char *preloadfile; > >@@ -426,4 +429,12 @@ > >+ if (strcmp(me, "sysfsctl") == 0) { >+ dst_path = SYSFS_PATH; >+ preloadfile = DEFAULT_SYSFS_PRELOAD; >+ } else { >+ dst_path = PROC_PATH; >+ preloadfile = DEFAULT_PRELOAD; >+ } >+ > if (argc < 2) { >- return Usage(me); >+ return Usage(me, preloadfile); > } >@@ -436,3 +447,3 @@ > if (!strcmp("--help",*argv)) { >- Usage(me); >+ Usage(me, preloadfile); > exit(0); >@@ -440,3 +451,3 @@ > if (!strcmp("--version",*argv)) { >- fprintf(stdout, "sysctl (%s)\n",procps_version); >+ fprintf(stdout, "%s (%s)\n",me,procps_version); > exit(0); >@@ -444,3 +455,3 @@ > fprintf(stderr, ERR_UNKNOWN_PARAMETER, *argv); >- return Usage(me); >+ return Usage(me, preloadfile); > } >@@ -484,5 +495,5 @@ > SwitchesAllowed = false; >- return DisplayAll(PROC_PATH); >+ return DisplayAll(dst_path); > case 'V': >- fprintf(stdout, "sysctl (%s)\n",procps_version); >+ fprintf(stdout, "%s (%s)\n",me,procps_version); > exit(0); >@@ -491,6 +502,6 @@ > case '?': >- return Usage(me); >+ return Usage(me, preloadfile); > default: > fprintf(stderr, ERR_UNKNOWN_PARAMETER, *argv); >- return Usage(me); >+ return Usage(me, preloadfile); > } >@@ -498,3 +509,3 @@ > if (NameOnly && Quiet) // nonsense >- return Usage(me); >+ return Usage(me, preloadfile); > SwitchesAllowed = false; >Index: Makefile >=================================================================== >RCS file: /cvsroot/procps/procps/Makefile,v >retrieving revision 1.64 >diff -u -U1 -r1.64 Makefile >--- Makefile >+++ Makefile >@@ -221,2 +221,3 @@ > cd $(usr/proc/bin) && $(ln_f) pgrep pkill >+ cd $(sbin) && $(ln_f) sysctl sysfsctl >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 94909
:
60513
|
60514
|
60583
|
60584
| 60625