[BusyBox-cvs] svn commit: branches/busybox_1_00_stable/busybox: libbb networking
landley at busybox.net
landley at busybox.net
Fri Aug 12 06:06:55 UTC 2005
Author: landley
Date: 2005-08-12 00:06:54 -0600 (Fri, 12 Aug 2005)
New Revision: 11119
Log:
Backport 10853, 10860/10870, and 10862.
Modified:
branches/busybox_1_00_stable/busybox/libbb/copy_file.c
branches/busybox_1_00_stable/busybox/networking/nc.c
branches/busybox_1_00_stable/busybox/networking/traceroute.c
Changeset:
Modified: branches/busybox_1_00_stable/busybox/libbb/copy_file.c
===================================================================
--- branches/busybox_1_00_stable/busybox/libbb/copy_file.c 2005-08-12 06:02:30 UTC (rev 11118)
+++ branches/busybox_1_00_stable/busybox/libbb/copy_file.c 2005-08-12 06:06:54 UTC (rev 11119)
@@ -197,12 +197,16 @@
S_ISSOCK(source_stat.st_mode) || S_ISFIFO(source_stat.st_mode) ||
S_ISLNK(source_stat.st_mode)) {
- if (dest_exists &&
- ((flags & FILEUTILS_FORCE) == 0 || unlink(dest) < 0)) {
+ if (dest_exists) {
+ if((flags & FILEUTILS_FORCE) == 0) {
+ fprintf(stderr, "`%s' exists\n", dest);
+ return -1;
+ }
+ if(unlink(dest) < 0) {
bb_perror_msg("unable to remove `%s'", dest);
return -1;
-
}
+ }
} else {
bb_error_msg("internal error: unrecognized file type");
return -1;
Modified: branches/busybox_1_00_stable/busybox/networking/nc.c
===================================================================
--- branches/busybox_1_00_stable/busybox/networking/nc.c 2005-08-12 06:02:30 UTC (rev 11118)
+++ branches/busybox_1_00_stable/busybox/networking/nc.c 2005-08-12 06:06:54 UTC (rev 11119)
@@ -161,8 +161,11 @@
exit(0);
ofd = STDOUT_FILENO;
} else {
- if (nread == 0)
- shutdown(sfd, 1);
+ if (nread <= 0) {
+ shutdown(sfd, 1 /* send */ );
+ close(STDIN_FILENO);
+ FD_CLR(STDIN_FILENO, &readfds);
+ }
ofd = sfd;
}
Modified: branches/busybox_1_00_stable/busybox/networking/traceroute.c
===================================================================
--- branches/busybox_1_00_stable/busybox/networking/traceroute.c 2005-08-12 06:02:30 UTC (rev 11118)
+++ branches/busybox_1_00_stable/busybox/networking/traceroute.c 2005-08-12 06:06:54 UTC (rev 11119)
@@ -101,7 +101,8 @@
#include "busybox.h"
-static u_char packet[512]; /* last inbound (icmp) packet */
+ /* last inbound (icmp) packet */
+static u_char packet[512] __attribute__ ((aligned));
static struct opacket *outpacket; /* last output (udp) packet */
static int s; /* receive (icmp) socket file descriptor */
More information about the busybox-cvs
mailing list