aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-08-26 21:36:32 +0000
committerEric Andersen <andersen@codepoet.org>2002-08-26 21:36:32 +0000
commit1130976f8ec187551c5c485bef3a0464a72f06a1 (patch)
tree745004e33cdc33d79cd23dae625662c47b63ea44
parentc3b7f7d6e710ad896349cd5a2e913d3efc79275d (diff)
downloadbusybox-w32-1130976f8ec187551c5c485bef3a0464a72f06a1.tar.gz
busybox-w32-1130976f8ec187551c5c485bef3a0464a72f06a1.tar.bz2
busybox-w32-1130976f8ec187551c5c485bef3a0464a72f06a1.zip
Eliminate use of obsolete sys_errlist[]
-Erik
-rw-r--r--init/init.c2
-rw-r--r--networking/udhcpc.c26
2 files changed, 14 insertions, 14 deletions
diff --git a/init/init.c b/init/init.c
index 569e7e460..7ab50cffe 100644
--- a/init/init.c
+++ b/init/init.c
@@ -782,7 +782,7 @@ static void exec_signal(int sig)
782 execl(a->command, a->command, NULL); 782 execl(a->command, a->command, NULL);
783 783
784 message(CONSOLE | LOG, "\rexec of '%s' failed: %s\n", 784 message(CONSOLE | LOG, "\rexec of '%s' failed: %s\n",
785 a->command, sys_errlist[errno]); 785 a->command, strerror(errno));
786 sync(); 786 sync();
787 sleep(2); 787 sleep(2);
788 init_reboot(RB_HALT_SYSTEM); 788 init_reboot(RB_HALT_SYSTEM);
diff --git a/networking/udhcpc.c b/networking/udhcpc.c
index 55b73b6b5..e2ba46bab 100644
--- a/networking/udhcpc.c
+++ b/networking/udhcpc.c
@@ -420,7 +420,7 @@ static int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip,
420 struct udp_dhcp_packet packet; 420 struct udp_dhcp_packet packet;
421 421
422 if ((l_fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) { 422 if ((l_fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) {
423 DEBUG(LOG_ERR, "socket call failed: %s", sys_errlist[errno]); 423 DEBUG(LOG_ERR, "socket call failed: %s", strerror(errno));
424 return -1; 424 return -1;
425 } 425 }
426 426
@@ -433,7 +433,7 @@ static int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip,
433 dest.sll_halen = 6; 433 dest.sll_halen = 6;
434 memcpy(dest.sll_addr, dest_arp, 6); 434 memcpy(dest.sll_addr, dest_arp, 6);
435 if (bind(l_fd, (struct sockaddr *) &dest, sizeof(struct sockaddr_ll)) < 0) { 435 if (bind(l_fd, (struct sockaddr *) &dest, sizeof(struct sockaddr_ll)) < 0) {
436 DEBUG(LOG_ERR, "bind call failed: %s", sys_errlist[errno]); 436 DEBUG(LOG_ERR, "bind call failed: %s", strerror(errno));
437 close(l_fd); 437 close(l_fd);
438 return -1; 438 return -1;
439 } 439 }
@@ -458,7 +458,7 @@ static int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip,
458 sendto(l_fd, &packet, sizeof(struct udp_dhcp_packet), 0, 458 sendto(l_fd, &packet, sizeof(struct udp_dhcp_packet), 0,
459 (struct sockaddr *) &dest, sizeof(dest)); 459 (struct sockaddr *) &dest, sizeof(dest));
460 if (result <= 0) { 460 if (result <= 0) {
461 DEBUG(LOG_ERR, "write on socket failed: %s", sys_errlist[errno]); 461 DEBUG(LOG_ERR, "write on socket failed: %s", strerror(errno));
462 } 462 }
463 close(l_fd); 463 close(l_fd);
464 return result; 464 return result;
@@ -900,7 +900,7 @@ static void run_script(struct dhcpMessage *packet, const char *name)
900 DEBUG(LOG_INFO, "execle'ing %s", client_config.script); 900 DEBUG(LOG_INFO, "execle'ing %s", client_config.script);
901 execle(client_config.script, client_config.script, name, NULL, envp); 901 execle(client_config.script, client_config.script, name, NULL, envp);
902 LOG(LOG_ERR, "script %s failed: %s", 902 LOG(LOG_ERR, "script %s failed: %s",
903 client_config.script, sys_errlist[errno]); 903 client_config.script, strerror(errno));
904 exit(1); 904 exit(1);
905 } 905 }
906} 906}
@@ -1007,7 +1007,7 @@ static inline int read_interface(char *interface, int *ifindex,
1007 DEBUG(LOG_INFO, "%s (our ip) = %s", ifr.ifr_name, 1007 DEBUG(LOG_INFO, "%s (our ip) = %s", ifr.ifr_name,
1008 inet_ntoa(s_in->sin_addr)); 1008 inet_ntoa(s_in->sin_addr));
1009 } else { 1009 } else {
1010 LOG(LOG_ERR, "SIOCGIFADDR failed!: %s", sys_errlist[errno]); 1010 LOG(LOG_ERR, "SIOCGIFADDR failed!: %s", strerror(errno));
1011 return -1; 1011 return -1;
1012 } 1012 }
1013 } 1013 }
@@ -1016,7 +1016,7 @@ static inline int read_interface(char *interface, int *ifindex,
1016 DEBUG(LOG_INFO, "adapter index %d", ifr.ifr_ifindex); 1016 DEBUG(LOG_INFO, "adapter index %d", ifr.ifr_ifindex);
1017 *ifindex = ifr.ifr_ifindex; 1017 *ifindex = ifr.ifr_ifindex;
1018 } else { 1018 } else {
1019 LOG(LOG_ERR, "SIOCGIFINDEX failed!: %s", sys_errlist[errno]); 1019 LOG(LOG_ERR, "SIOCGIFINDEX failed!: %s", strerror(errno));
1020 return -1; 1020 return -1;
1021 } 1021 }
1022 if (ioctl(l_fd, SIOCGIFHWADDR, &ifr) == 0) { 1022 if (ioctl(l_fd, SIOCGIFHWADDR, &ifr) == 0) {
@@ -1025,11 +1025,11 @@ static inline int read_interface(char *interface, int *ifindex,
1025 "adapter hardware address %02x:%02x:%02x:%02x:%02x:%02x", 1025 "adapter hardware address %02x:%02x:%02x:%02x:%02x:%02x",
1026 arp[0], arp[1], arp[2], arp[3], arp[4], arp[5]); 1026 arp[0], arp[1], arp[2], arp[3], arp[4], arp[5]);
1027 } else { 1027 } else {
1028 LOG(LOG_ERR, "SIOCGIFHWADDR failed!: %s", sys_errlist[errno]); 1028 LOG(LOG_ERR, "SIOCGIFHWADDR failed!: %s", strerror(errno));
1029 return -1; 1029 return -1;
1030 } 1030 }
1031 } else { 1031 } else {
1032 LOG(LOG_ERR, "socket failed!: %s", sys_errlist[errno]); 1032 LOG(LOG_ERR, "socket failed!: %s", strerror(errno));
1033 return -1; 1033 return -1;
1034 } 1034 }
1035 close(l_fd); 1035 close(l_fd);
@@ -1046,7 +1046,7 @@ static inline int listen_socket(unsigned int ip, int port, char *inf)
1046 1046
1047 DEBUG(LOG_INFO, "Opening listen socket on 0x%08x:%d %s\n", ip, port, inf); 1047 DEBUG(LOG_INFO, "Opening listen socket on 0x%08x:%d %s\n", ip, port, inf);
1048 if ((l_fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) { 1048 if ((l_fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
1049 DEBUG(LOG_ERR, "socket call failed: %s", sys_errlist[errno]); 1049 DEBUG(LOG_ERR, "socket call failed: %s", strerror(errno));
1050 return -1; 1050 return -1;
1051 } 1051 }
1052 1052
@@ -1090,7 +1090,7 @@ static int raw_socket(int ifindex)
1090 1090
1091 DEBUG(LOG_INFO, "Opening raw socket on ifindex %d\n", ifindex); 1091 DEBUG(LOG_INFO, "Opening raw socket on ifindex %d\n", ifindex);
1092 if ((l_fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) { 1092 if ((l_fd = socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP))) < 0) {
1093 DEBUG(LOG_ERR, "socket call failed: %s", sys_errlist[errno]); 1093 DEBUG(LOG_ERR, "socket call failed: %s", strerror(errno));
1094 return -1; 1094 return -1;
1095 } 1095 }
1096 1096
@@ -1098,7 +1098,7 @@ static int raw_socket(int ifindex)
1098 sock.sll_protocol = htons(ETH_P_IP); 1098 sock.sll_protocol = htons(ETH_P_IP);
1099 sock.sll_ifindex = ifindex; 1099 sock.sll_ifindex = ifindex;
1100 if (bind(l_fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) { 1100 if (bind(l_fd, (struct sockaddr *) &sock, sizeof(sock)) < 0) {
1101 DEBUG(LOG_ERR, "bind call failed: %s", sys_errlist[errno]); 1101 DEBUG(LOG_ERR, "bind call failed: %s", strerror(errno));
1102 close(l_fd); 1102 close(l_fd);
1103 return -1; 1103 return -1;
1104 } 1104 }
@@ -1375,7 +1375,7 @@ int udhcpc_main(int argc, char *argv[])
1375 } 1375 }
1376 if (fd_main < 0) { 1376 if (fd_main < 0) {
1377 LOG(LOG_ERR, "FATAL: couldn't listen on socket, %s", 1377 LOG(LOG_ERR, "FATAL: couldn't listen on socket, %s",
1378 sys_errlist[errno]); 1378 strerror(errno));
1379 exit_client(0); 1379 exit_client(0);
1380 } 1380 }
1381 } 1381 }
@@ -1488,7 +1488,7 @@ int udhcpc_main(int argc, char *argv[])
1488 } 1488 }
1489 if (len == -1 && errno != EINTR) { 1489 if (len == -1 && errno != EINTR) {
1490 DEBUG(LOG_INFO, "error on read, %s, reopening socket", 1490 DEBUG(LOG_INFO, "error on read, %s, reopening socket",
1491 sys_errlist[errno]); 1491 strerror(errno));
1492 change_mode(listen_mode); /* just close and reopen */ 1492 change_mode(listen_mode); /* just close and reopen */
1493 } 1493 }
1494 if (len < 0) { 1494 if (len < 0) {