diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-01 00:22:24 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-01 00:22:24 +0000 |
commit | 5a89763fb7e57d4fc3d393eafa35c58f8285a083 (patch) | |
tree | 8b1e93ed2685ff31c32e851871a6a57dda4fbcea | |
parent | 44d5dcebc6d3d896e8a5de07cb57913d961067c8 (diff) | |
download | busybox-w32-5a89763fb7e57d4fc3d393eafa35c58f8285a083.tar.gz busybox-w32-5a89763fb7e57d4fc3d393eafa35c58f8285a083.tar.bz2 busybox-w32-5a89763fb7e57d4fc3d393eafa35c58f8285a083.zip |
tftpd: show help if stdin is not a socket
-rw-r--r-- | networking/tftp.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/networking/tftp.c b/networking/tftp.c index 07d672dcb..eb39e9c54 100644 --- a/networking/tftp.c +++ b/networking/tftp.c | |||
@@ -653,8 +653,15 @@ int tftpd_main(int argc UNUSED_PARAM, char **argv) | |||
653 | INIT_G(); | 653 | INIT_G(); |
654 | 654 | ||
655 | our_lsa = get_sock_lsa(STDIN_FILENO); | 655 | our_lsa = get_sock_lsa(STDIN_FILENO); |
656 | if (!our_lsa) | 656 | if (!our_lsa) { |
657 | bb_perror_msg_and_die("stdin is not a socket"); | 657 | /* This is confusing: |
658 | *bb_error_msg_and_die("stdin is not a socket"); | ||
659 | * Better: */ | ||
660 | bb_show_usage(); | ||
661 | /* Help text says that tftpd must be used as inetd service, | ||
662 | * which is by far the most usual cause of get_sock_lsa | ||
663 | * failure */ | ||
664 | } | ||
658 | peer_lsa = xzalloc(LSA_LEN_SIZE + our_lsa->len); | 665 | peer_lsa = xzalloc(LSA_LEN_SIZE + our_lsa->len); |
659 | peer_lsa->len = our_lsa->len; | 666 | peer_lsa->len = our_lsa->len; |
660 | 667 | ||