aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2005-08-12 06:06:54 +0000
committerRob Landley <rob@landley.net>2005-08-12 06:06:54 +0000
commitd5138f44fe2e496498c62a06b7f50381edf952da (patch)
treeb0c7e721ab4924d93491876f5e859389eb22b039
parent9344d8aa10ecf99aba3eae97e4fa131360f89729 (diff)
downloadbusybox-w32-d5138f44fe2e496498c62a06b7f50381edf952da.tar.gz
busybox-w32-d5138f44fe2e496498c62a06b7f50381edf952da.tar.bz2
busybox-w32-d5138f44fe2e496498c62a06b7f50381edf952da.zip
Backport 10853, 10860/10870, and 10862.
-rw-r--r--busybox/libbb/copy_file.c10
-rw-r--r--busybox/networking/nc.c7
-rw-r--r--busybox/networking/traceroute.c3
3 files changed, 14 insertions, 6 deletions
diff --git a/busybox/libbb/copy_file.c b/busybox/libbb/copy_file.c
index 68a1ded04..4b349b7fc 100644
--- a/busybox/libbb/copy_file.c
+++ b/busybox/libbb/copy_file.c
@@ -197,12 +197,16 @@ int copy_file(const char *source, const char *dest, int flags)
197 S_ISSOCK(source_stat.st_mode) || S_ISFIFO(source_stat.st_mode) || 197 S_ISSOCK(source_stat.st_mode) || S_ISFIFO(source_stat.st_mode) ||
198 S_ISLNK(source_stat.st_mode)) { 198 S_ISLNK(source_stat.st_mode)) {
199 199
200 if (dest_exists && 200 if (dest_exists) {
201 ((flags & FILEUTILS_FORCE) == 0 || unlink(dest) < 0)) { 201 if((flags & FILEUTILS_FORCE) == 0) {
202 fprintf(stderr, "`%s' exists\n", dest);
203 return -1;
204 }
205 if(unlink(dest) < 0) {
202 bb_perror_msg("unable to remove `%s'", dest); 206 bb_perror_msg("unable to remove `%s'", dest);
203 return -1; 207 return -1;
204
205 } 208 }
209 }
206 } else { 210 } else {
207 bb_error_msg("internal error: unrecognized file type"); 211 bb_error_msg("internal error: unrecognized file type");
208 return -1; 212 return -1;
diff --git a/busybox/networking/nc.c b/busybox/networking/nc.c
index ab8ec0cd5..6ce85fecf 100644
--- a/busybox/networking/nc.c
+++ b/busybox/networking/nc.c
@@ -161,8 +161,11 @@ int nc_main(int argc, char **argv)
161 exit(0); 161 exit(0);
162 ofd = STDOUT_FILENO; 162 ofd = STDOUT_FILENO;
163 } else { 163 } else {
164 if (nread == 0) 164 if (nread <= 0) {
165 shutdown(sfd, 1); 165 shutdown(sfd, 1 /* send */ );
166 close(STDIN_FILENO);
167 FD_CLR(STDIN_FILENO, &readfds);
168 }
166 ofd = sfd; 169 ofd = sfd;
167 } 170 }
168 171
diff --git a/busybox/networking/traceroute.c b/busybox/networking/traceroute.c
index 44ffdf07e..cf90ec088 100644
--- a/busybox/networking/traceroute.c
+++ b/busybox/networking/traceroute.c
@@ -101,7 +101,8 @@ struct opacket {
101 101
102#include "busybox.h" 102#include "busybox.h"
103 103
104static u_char packet[512]; /* last inbound (icmp) packet */ 104 /* last inbound (icmp) packet */
105static u_char packet[512] __attribute__ ((aligned));
105static struct opacket *outpacket; /* last output (udp) packet */ 106static struct opacket *outpacket; /* last output (udp) packet */
106 107
107static int s; /* receive (icmp) socket file descriptor */ 108static int s; /* receive (icmp) socket file descriptor */