svn commit: trunk/busybox/networking
vda at busybox.net
vda at busybox.net
Sat Nov 1 00:22:24 UTC 2008
Author: vda
Date: 2008-10-31 17:22:24 -0700 (Fri, 31 Oct 2008)
New Revision: 23889
Log:
tftpd: show help if stdin is not a socket
Modified:
trunk/busybox/networking/tftp.c
Changeset:
Modified: trunk/busybox/networking/tftp.c
===================================================================
--- trunk/busybox/networking/tftp.c 2008-11-01 00:10:51 UTC (rev 23888)
+++ trunk/busybox/networking/tftp.c 2008-11-01 00:22:24 UTC (rev 23889)
@@ -653,8 +653,15 @@
INIT_G();
our_lsa = get_sock_lsa(STDIN_FILENO);
- if (!our_lsa)
- bb_perror_msg_and_die("stdin is not a socket");
+ if (!our_lsa) {
+ /* This is confusing:
+ *bb_error_msg_and_die("stdin is not a socket");
+ * Better: */
+ bb_show_usage();
+ /* Help text says that tftpd must be used as inetd service,
+ * which is by far the most usual cause of get_sock_lsa
+ * failure */
+ }
peer_lsa = xzalloc(LSA_LEN_SIZE + our_lsa->len);
peer_lsa->len = our_lsa->len;
More information about the busybox-cvs
mailing list