aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-10-15 08:45:54 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-10-15 08:45:54 +0000
commit81944c9e92991eff0d1a9fc289b21cc745f43f9c (patch)
tree739e41ca3d12bc394d265c7f1a47a93f1e811a7b
parentcfdb711a18f0f713fe803d3e3e22a95bed193ceb (diff)
downloadbusybox-w32-81944c9e92991eff0d1a9fc289b21cc745f43f9c.tar.gz
busybox-w32-81944c9e92991eff0d1a9fc289b21cc745f43f9c.tar.bz2
busybox-w32-81944c9e92991eff0d1a9fc289b21cc745f43f9c.zip
sysctl: remove trivial comments. no code changes
-rw-r--r--procps/sysctl.c39
1 files changed, 12 insertions, 27 deletions
diff --git a/procps/sysctl.c b/procps/sysctl.c
index c095d16d0..90e47ea9a 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -70,41 +70,32 @@ int sysctl_main(int argc UNUSED_PARAM, char **argv)
70 return retval; 70 return retval;
71} /* end sysctl_main() */ 71} /* end sysctl_main() */
72 72
73/* 73/* Set sysctl's from a conf file. Format example:
74 * preload the sysctl's from a conf file 74 * # Controls IP packet forwarding
75 * - we parse the file and then reform it (strip out whitespace) 75 * net.ipv4.ip_forward = 0
76 */ 76 */
77
78static int sysctl_preload_file_and_exit(const char *filename) 77static int sysctl_preload_file_and_exit(const char *filename)
79{ 78{
80 char *token[2]; 79 char *token[2];
81 parser_t *parser; 80 parser_t *parser;
82 81
83 parser = config_open(filename); 82 parser = config_open(filename);
84 while (config_read(parser, token, 2, 2, "# \t=", PARSE_NORMAL)) { // TODO: ';' is comment char too 83// TODO: ';' is comment char too
85// if (!token[1]) { 84 while (config_read(parser, token, 2, 2, "# \t=", PARSE_NORMAL)) {
86// bb_error_msg("warning: %s(%d): invalid syntax, continuing",
87// filename, parser->lineno);
88// } else {
89 {
90#if 0 85#if 0
91 char *s = xasprintf("%s=%s", token[0], token[1]); 86 char *s = xasprintf("%s=%s", token[0], token[1]);
92 sysctl_write_setting(s); 87 sysctl_write_setting(s);
93 free(s); 88 free(s);
94#else // PLAY_WITH_FIRE for -4 bytes? 89#else /* Save ~4 bytes by using parser internals */
95 sprintf(parser->line, "%s=%s", token[0], token[1]); // must have room by definition 90 sprintf(parser->line, "%s=%s", token[0], token[1]); // must have room by definition
96 sysctl_write_setting(parser->line); 91 sysctl_write_setting(parser->line);
97#endif 92#endif
98 }
99 } 93 }
100 if (ENABLE_FEATURE_CLEAN_UP) 94 if (ENABLE_FEATURE_CLEAN_UP)
101 config_close(parser); 95 config_close(parser);
102 return 0; 96 return 0;
103} /* end sysctl_preload_file_and_exit() */ 97} /* end sysctl_preload_file_and_exit() */
104 98
105/*
106 * Write a single sysctl setting
107 */
108static int sysctl_write_setting(const char *setting) 99static int sysctl_write_setting(const char *setting)
109{ 100{
110 int retval; 101 int retval;
@@ -162,9 +153,6 @@ static int sysctl_write_setting(const char *setting)
162 return retval; 153 return retval;
163} /* end sysctl_write_setting() */ 154} /* end sysctl_write_setting() */
164 155
165/*
166 * Read a sysctl setting
167 */
168static int sysctl_read_setting(const char *name) 156static int sysctl_read_setting(const char *name)
169{ 157{
170 int retval; 158 int retval;
@@ -214,12 +202,9 @@ static int sysctl_read_setting(const char *name)
214 return retval; 202 return retval;
215} /* end sysctl_read_setting() */ 203} /* end sysctl_read_setting() */
216 204
217/*
218 * Display all the sysctl settings
219 */
220static int sysctl_display_all(const char *path) 205static int sysctl_display_all(const char *path)
221{ 206{
222 int retval = 0; 207 int retval = EXIT_SUCCESS;
223 DIR *dp; 208 DIR *dp;
224 struct dirent *de; 209 struct dirent *de;
225 char *tmpdir; 210 char *tmpdir;