Question on bb_info_msg, printf, and bb_error_msg?
Michael D. Setzer II
mikes at kuentos.guam.net
Sun Jun 26 03:06:52 UTC 2016
Posted an earlier message about changes in 1.25.0.
At the time, I didn't find mention of these in the changes listed, but didn't
know that it was the change from using bb_info_msg to bb_error_msg that
was change output to go to stderr instead of stdout. Noticed that other
changes have bb_info_msg going to printf? So, what was the problem with
bb_info_msg that it needed to be changed? And why where some changes
to printf and other to bb_error_msg?? Also, noted a major changes in the
text, where before they started with a capital letter, but now are all lower
case?
This is comparing the 1.24.2 and 1.25.0 versions of this file.
diff between dhcpc.c
< static const uint8_t len_of_option_as_string[] ALIGN1 = {
> static const uint8_t len_of_option_as_string[] = {
< if (*name == '\0')
< return 1; // We allow trailing dot too
< log1("executing %s %s", client_config.script, name);
> log1("Executing %s %s", client_config.script, name);
< static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet,
uint32_t src_nip)
> static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet)
< /*src*/ src_nip, CLIENT_PORT,
> /*src*/ INADDR_ANY, CLIENT_PORT,
< return raw_bcast_from_client_config_ifindex(packet, ciaddr);
> return raw_bcast_from_client_config_ifindex(packet);
< bb_error_msg("sending %s", "discover");
< return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
> bb_info_msg("Sending discover...");
> return raw_bcast_from_client_config_ifindex(&packet);
< bb_error_msg("sending select for %s", inet_ntoa(addr));
< return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
> bb_info_msg("Sending select for %s...", inet_ntoa(addr));
> return raw_bcast_from_client_config_ifindex(&packet);
< bb_error_msg("sending %s", "renew");
> bb_info_msg("Sending renew...");
< bb_error_msg("sending %s", "decline");
< return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
> bb_info_msg("Sending decline...");
> return raw_bcast_from_client_config_ifindex(&packet);
< bb_error_msg("sending %s", "release");
> bb_info_msg("Sending release...");
< log1("packet read error, ignoring");
> log1("Packet read error, ignoring");
< log1("packet is too short, ignoring");
> log1("Packet is too short, ignoring");
< log1("oversized packet, ignoring");
> log1("Oversized packet, ignoring");
< log1("unrelated/bogus packet, ignoring");
> log1("Unrelated/bogus packet, ignoring");
< log1("bad IP header checksum, ignoring");
> log1("Bad IP header checksum, ignoring");
< log1("packet with bad UDP checksum received, ignoring");
> log1("Packet with bad UDP checksum received, ignoring");
< bb_error_msg("packet with bad magic, ignoring");
> bb_info_msg("Packet with bad magic, ignoring");
< log1("received %s", "a packet");
> log1("Received a packet");
< log1("opening raw socket on ifindex %d", ifindex); //log2?
> log1("Opening raw socket on ifindex %d", ifindex); //log2?
< log1("got raw socket fd"); //log2?
> log1("Got raw socket fd"); //log2?
< log1("attached filter to raw socket fd"); // log?
> log1("Attached filter to raw socket fd"); // log?
< log1("can't set PACKET_AUXDATA on raw socket");
> log1("Can't set PACKET_AUXDATA on raw socket");
< log1("created raw socket");
> log1("Created raw socket");
< log1("entering listen mode: %s",
> log1("Entering listen mode: %s",
< bb_error_msg("performing DHCP renew");
> bb_info_msg("Performing a DHCP renew");
< bb_error_msg("unicasting a release of %s to %s",
> bb_info_msg("Unicasting a release of %s to %s",
< bb_error_msg("entering released state");
> bb_info_msg("Entering released state");
< setup_common_bufsiz();
<
< bb_error_msg("started, v"BB_VER);
> bb_info_msg("%s (v"BB_VER") started", applet_name);
< log1("waiting on select %u seconds", (int)tv.tv_sec);
> log1("Waiting on select %u seconds", (int)tv.tv_sec);
< bb_error_msg("no lease, forking to
background");
> bb_info_msg("No lease, forking to
background");
< bb_error_msg("no lease, failing");
> bb_info_msg("No lease, failing");
< if (packet_num < 3) {
> if (!discover_retries || packet_num <
discover_retries) {
< log1("entering renew state");
> log1("Entering renew state");
< log1("entering rebinding state");
> log1("Entering rebinding state");
< bb_error_msg("lease lost, entering init state");
> bb_info_msg("Lease lost, entering init state");
< bb_error_msg("received %s", "SIGTERM");
> bb_info_msg("Received SIGTERM");
< bb_error_msg("read error: %s, reopening socket",
strerror(errno));
> bb_info_msg("Read error: %s, reopening socket",
strerror(errno));
< bb_error_msg("offered address is in
use "
> bb_info_msg("Offered address is in
use "
< bb_error_msg("lease of %s obtained, lease time
%u",
> bb_info_msg("Lease of %s obtained, lease time
%u",
< bb_error_msg("received %s", "DHCP NAK");
> bb_info_msg("Received DHCP NAK");
+----------------------------------------------------------+
Michael D. Setzer II - Computer Science Instructor
Guam Community College Computer Center
mailto:mikes at kuentos.guam.net
mailto:msetzerii at gmail.com
Guam - Where America's Day Begins
G4L Disk Imaging Project maintainer
http://sourceforge.net/projects/g4l/
+----------------------------------------------------------+
http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned: 19,471
Processing time: 32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)
BOINC at HOME CREDITS
ABC 16613838.513356 | EINSTEIN
102680088.45569545403128.470288
ROSETTA 45403128.470288 | SETI 85345255.983684
More information about the busybox
mailing list