summaryrefslogtreecommitdiff
path: root/networking/udhcp
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
committerRob Landley <rob@landley.net>2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /networking/udhcp
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.bz2
busybox-w32-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
Diffstat (limited to 'networking/udhcp')
-rw-r--r--networking/udhcp/libbb_udhcp.h2
-rw-r--r--networking/udhcp/script.c12
2 files changed, 6 insertions, 8 deletions
diff --git a/networking/udhcp/libbb_udhcp.h b/networking/udhcp/libbb_udhcp.h
index 3cf2d1401..c21d3baab 100644
--- a/networking/udhcp/libbb_udhcp.h
+++ b/networking/udhcp/libbb_udhcp.h
@@ -20,8 +20,6 @@
20 20
21#define COMBINED_BINARY 21#define COMBINED_BINARY
22 22
23#define xfopen bb_xfopen
24
25void udhcp_background(const char *pidfile); 23void udhcp_background(const char *pidfile);
26void udhcp_start_log_and_pid(const char *client_server, const char *pidfile); 24void udhcp_start_log_and_pid(const char *client_server, const char *pidfile);
27void udhcp_logging(int level, const char *fmt, ...); 25void udhcp_logging(int level, const char *fmt, ...);
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c
index 8c4933455..5a4b33a53 100644
--- a/networking/udhcp/script.c
+++ b/networking/udhcp/script.c
@@ -149,10 +149,10 @@ static char **fill_envp(struct dhcpMessage *packet)
149 149
150 envp = xzalloc(sizeof(char *) * (num_options + 5)); 150 envp = xzalloc(sizeof(char *) * (num_options + 5));
151 j = 0; 151 j = 0;
152 envp[j++] = bb_xasprintf("interface=%s", client_config.interface); 152 envp[j++] = xasprintf("interface=%s", client_config.interface);
153 envp[j++] = bb_xasprintf("PATH=%s", 153 envp[j++] = xasprintf("PATH=%s",
154 getenv("PATH") ? : "/bin:/usr/bin:/sbin:/usr/sbin"); 154 getenv("PATH") ? : "/bin:/usr/bin:/sbin:/usr/sbin");
155 envp[j++] = bb_xasprintf("HOME=%s", getenv("HOME") ? : "/"); 155 envp[j++] = xasprintf("HOME=%s", getenv("HOME") ? : "/");
156 156
157 if (packet == NULL) return envp; 157 if (packet == NULL) return envp;
158 158
@@ -170,7 +170,7 @@ static char **fill_envp(struct dhcpMessage *packet)
170 /* Fill in a subnet bits option for things like /24 */ 170 /* Fill in a subnet bits option for things like /24 */
171 if (dhcp_options[i].code == DHCP_SUBNET) { 171 if (dhcp_options[i].code == DHCP_SUBNET) {
172 memcpy(&subnet, temp, 4); 172 memcpy(&subnet, temp, 4);
173 envp[j++] = bb_xasprintf("mask=%d", mton(&subnet)); 173 envp[j++] = xasprintf("mask=%d", mton(&subnet));
174 } 174 }
175 } 175 }
176 if (packet->siaddr) { 176 if (packet->siaddr) {
@@ -180,12 +180,12 @@ static char **fill_envp(struct dhcpMessage *packet)
180 if (!(over & FILE_FIELD) && packet->file[0]) { 180 if (!(over & FILE_FIELD) && packet->file[0]) {
181 /* watch out for invalid packets */ 181 /* watch out for invalid packets */
182 packet->file[sizeof(packet->file) - 1] = '\0'; 182 packet->file[sizeof(packet->file) - 1] = '\0';
183 envp[j++] = bb_xasprintf("boot_file=%s", packet->file); 183 envp[j++] = xasprintf("boot_file=%s", packet->file);
184 } 184 }
185 if (!(over & SNAME_FIELD) && packet->sname[0]) { 185 if (!(over & SNAME_FIELD) && packet->sname[0]) {
186 /* watch out for invalid packets */ 186 /* watch out for invalid packets */
187 packet->sname[sizeof(packet->sname) - 1] = '\0'; 187 packet->sname[sizeof(packet->sname) - 1] = '\0';
188 envp[j++] = bb_xasprintf("sname=%s", packet->sname); 188 envp[j++] = xasprintf("sname=%s", packet->sname);
189 } 189 }
190 return envp; 190 return envp;
191} 191}