diff options
author | mestre <mestre@cvs.openbsd.org> | 2016-02-01 07:29:26 +0000 |
---|---|---|
committer | mestre <mestre@cvs.openbsd.org> | 2016-02-01 07:29:26 +0000 |
commit | 4a943cbdc379e9bf9c12f0ddfa7d625be99a8feb (patch) | |
tree | 96e5a9910da361e3177ab052cb228c235b0f9900 | |
parent | a14c7584d7ff1b587f6535df1933a5add8b08993 (diff) |
Remove unused headers and sort the remaining
Remove lint-style comments
Swap hardcoded string on usage() for __progname
OK tb@
-rw-r--r-- | usr.bin/talk/ctl.c | 7 | ||||
-rw-r--r-- | usr.bin/talk/ctl_transact.c | 10 | ||||
-rw-r--r-- | usr.bin/talk/display.c | 5 | ||||
-rw-r--r-- | usr.bin/talk/get_addrs.c | 8 | ||||
-rw-r--r-- | usr.bin/talk/get_names.c | 14 | ||||
-rw-r--r-- | usr.bin/talk/init_disp.c | 6 | ||||
-rw-r--r-- | usr.bin/talk/invite.c | 11 | ||||
-rw-r--r-- | usr.bin/talk/io.c | 10 | ||||
-rw-r--r-- | usr.bin/talk/look_up.c | 8 | ||||
-rw-r--r-- | usr.bin/talk/msgs.c | 4 | ||||
-rw-r--r-- | usr.bin/talk/talk.c | 7 | ||||
-rw-r--r-- | usr.bin/talk/talk.h | 7 |
12 files changed, 57 insertions, 40 deletions
diff --git a/usr.bin/talk/ctl.c b/usr.bin/talk/ctl.c index ff106a01604..e81d4bdeecf 100644 --- a/usr.bin/talk/ctl.c +++ b/usr.bin/talk/ctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ctl.c,v 1.12 2010/08/12 23:31:29 tedu Exp $ */ +/* $OpenBSD: ctl.c,v 1.13 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: ctl.c,v 1.3 1994/12/09 02:14:10 jtc Exp $ */ /* @@ -36,9 +36,10 @@ * the progress */ -#include "talk.h" +#include <sys/socket.h> #include <arpa/inet.h> -#include "talk_ctl.h" + +#include "talk.h" struct sockaddr_in daemon_addr = { sizeof(daemon_addr), AF_INET }; struct sockaddr_in ctl_addr = { sizeof(ctl_addr), AF_INET }; diff --git a/usr.bin/talk/ctl_transact.c b/usr.bin/talk/ctl_transact.c index 8f33d194d58..8852b064b19 100644 --- a/usr.bin/talk/ctl_transact.c +++ b/usr.bin/talk/ctl_transact.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ctl_transact.c,v 1.12 2010/08/12 23:31:29 tedu Exp $ */ +/* $OpenBSD: ctl_transact.c,v 1.13 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: ctl_transact.c,v 1.3 1994/12/09 02:14:12 jtc Exp $ */ /* @@ -30,11 +30,13 @@ * SUCH DAMAGE. */ -#include "talk.h" -#include <sys/time.h> +#include <sys/socket.h> +#include <netinet/in.h> + #include <errno.h> -#include <unistd.h> #include <poll.h> + +#include "talk.h" #include "talk_ctl.h" #define CTL_WAIT 2 /* time to wait for a response, in seconds */ diff --git a/usr.bin/talk/display.c b/usr.bin/talk/display.c index 6b080952e81..c7feb1ddc5f 100644 --- a/usr.bin/talk/display.c +++ b/usr.bin/talk/display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: display.c,v 1.17 2013/11/28 18:24:55 deraadt Exp $ */ +/* $OpenBSD: display.c,v 1.18 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: display.c,v 1.3 1994/12/09 02:14:13 jtc Exp $ */ /* @@ -34,9 +34,10 @@ * The window 'manager', initializes curses and handles the actual * displaying of text */ -#include "talk.h" #include <ctype.h> +#include "talk.h" + xwin_t my_win; xwin_t his_win; WINDOW *line_win; diff --git a/usr.bin/talk/get_addrs.c b/usr.bin/talk/get_addrs.c index c437d2e6c0a..7bb4dc90f37 100644 --- a/usr.bin/talk/get_addrs.c +++ b/usr.bin/talk/get_addrs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: get_addrs.c,v 1.9 2010/08/12 23:31:29 tedu Exp $ */ +/* $OpenBSD: get_addrs.c,v 1.10 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: get_addrs.c,v 1.3 1994/12/09 02:14:14 jtc Exp $ */ /* @@ -30,10 +30,12 @@ * SUCH DAMAGE. */ -#include "talk.h" +#include <err.h> #include <netdb.h> -#include <stdio.h> +#include <string.h> #include <unistd.h> + +#include "talk.h" #include "talk_ctl.h" void diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c index c4cd1d2858f..5e0244c445c 100644 --- a/usr.bin/talk/get_names.c +++ b/usr.bin/talk/get_names.c @@ -1,4 +1,4 @@ -/* $OpenBSD: get_names.c,v 1.20 2015/01/16 06:40:13 deraadt Exp $ */ +/* $OpenBSD: get_names.c,v 1.21 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: get_names.c,v 1.4 1994/12/09 02:14:16 jtc Exp $ */ /* @@ -30,11 +30,16 @@ * SUCH DAMAGE. */ -#include "talk.h" +#include <sys/socket.h> + +#include <err.h> +#include <limits.h> #include <pwd.h> #include <stdlib.h> +#include <string.h> #include <unistd.h> -#include <limits.h> + +#include "talk.h" extern CTL_MSG msg; @@ -66,7 +71,8 @@ get_names(int argc, char *argv[]) } if ((argc < 2 ) || ('@' == argv[1][0])) { - fprintf(stderr, "usage: talk [-Hs] person [ttyname]\n"); + extern char *__progname; + fprintf(stderr, "usage: %s [-Hs] person [ttyname]\n", __progname); exit(1); } if (!isatty(STDIN_FILENO)) diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c index e239b05b508..76dbb7f3865 100644 --- a/usr.bin/talk/init_disp.c +++ b/usr.bin/talk/init_disp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_disp.c,v 1.21 2013/12/11 14:28:20 naddy Exp $ */ +/* $OpenBSD: init_disp.c,v 1.22 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: init_disp.c,v 1.6 1994/12/09 02:14:17 jtc Exp $ */ /* @@ -35,13 +35,15 @@ * as well as the signal handling routines. */ -#include "talk.h" #include <sys/ioctl.h> + #include <err.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> +#include "talk.h" + /* * Set up curses, catch the appropriate signals, * and build the various windows. diff --git a/usr.bin/talk/invite.c b/usr.bin/talk/invite.c index b12a20d01d0..9f07a7ebbbe 100644 --- a/usr.bin/talk/invite.c +++ b/usr.bin/talk/invite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: invite.c,v 1.15 2013/03/11 17:40:11 deraadt Exp $ */ +/* $OpenBSD: invite.c,v 1.16 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: invite.c,v 1.3 1994/12/09 02:14:18 jtc Exp $ */ /* @@ -30,13 +30,16 @@ * SUCH DAMAGE. */ -#include "talk.h" +#include <sys/socket.h> #include <arpa/inet.h> -#include <sys/time.h> -#include <netdb.h> + +#include <err.h> #include <errno.h> +#include <netdb.h> #include <setjmp.h> #include <unistd.h> + +#include "talk.h" #include "talk_ctl.h" #define STRING_LENGTH 158 diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c index a56958213c2..908daab6ad5 100644 --- a/usr.bin/talk/io.c +++ b/usr.bin/talk/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.18 2010/08/12 23:31:29 tedu Exp $ */ +/* $OpenBSD: io.c,v 1.19 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: io.c,v 1.4 1994/12/09 02:14:20 jtc Exp $ */ /* @@ -36,14 +36,14 @@ * ctl.c */ -#include "talk.h" #include <sys/ioctl.h> -#include <sys/time.h> -#include <stdio.h> -#include <poll.h> + #include <errno.h> +#include <poll.h> #include <unistd.h> +#include "talk.h" + #define A_LONG_TIME 1000000 volatile sig_atomic_t gotwinch; diff --git a/usr.bin/talk/look_up.c b/usr.bin/talk/look_up.c index 695818306bc..a3140e055af 100644 --- a/usr.bin/talk/look_up.c +++ b/usr.bin/talk/look_up.c @@ -1,4 +1,4 @@ -/* $OpenBSD: look_up.c,v 1.12 2010/08/12 23:31:29 tedu Exp $ */ +/* $OpenBSD: look_up.c,v 1.13 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: look_up.c,v 1.3 1994/12/09 02:14:21 jtc Exp $ */ /* @@ -30,9 +30,12 @@ * SUCH DAMAGE. */ -#include "talk.h" +#include <sys/socket.h> + #include <errno.h> #include <unistd.h> + +#include "talk.h" #include "talk_ctl.h" /* @@ -81,7 +84,6 @@ check_local(void) return (0); } quit("Unable to connect with initiator", 1); - /*NOTREACHED*/ return (0); } diff --git a/usr.bin/talk/msgs.c b/usr.bin/talk/msgs.c index 94de95d406a..39ecb2e526f 100644 --- a/usr.bin/talk/msgs.c +++ b/usr.bin/talk/msgs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msgs.c,v 1.10 2010/08/12 23:31:29 tedu Exp $ */ +/* $OpenBSD: msgs.c,v 1.11 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: msgs.c,v 1.3 1994/12/09 02:14:22 jtc Exp $ */ /* @@ -36,8 +36,6 @@ */ #include "talk.h" -#include <sys/time.h> -#include <stdio.h> #define MSG_INTERVAL 4 diff --git a/usr.bin/talk/talk.c b/usr.bin/talk/talk.c index a85c9cb13e1..b10ad857a5a 100644 --- a/usr.bin/talk/talk.c +++ b/usr.bin/talk/talk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: talk.c,v 1.9 2009/10/27 23:59:44 deraadt Exp $ */ +/* $OpenBSD: talk.c,v 1.10 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: talk.c,v 1.3 1994/12/09 02:14:25 jtc Exp $ */ /* @@ -30,6 +30,10 @@ * SUCH DAMAGE. */ +#include <err.h> +#include <string.h> +#include <unistd.h> + #include "talk.h" /* @@ -59,6 +63,5 @@ main(int argc, char *argv[]) end_msgs(); set_edit_chars(); talk(); - /* NOTREACHED */ return (0); } diff --git a/usr.bin/talk/talk.h b/usr.bin/talk/talk.h index 468f1816a9a..b9ade55e753 100644 --- a/usr.bin/talk/talk.h +++ b/usr.bin/talk/talk.h @@ -1,4 +1,4 @@ -/* $OpenBSD: talk.h,v 1.11 2009/05/09 11:05:01 chl Exp $ */ +/* $OpenBSD: talk.h,v 1.12 2016/02/01 07:29:25 mestre Exp $ */ /* $NetBSD: talk.h,v 1.3 1994/12/09 02:14:27 jtc Exp $ */ /* @@ -32,14 +32,11 @@ * @(#)talk.h 8.1 (Berkeley) 6/6/93 */ -#include <sys/types.h> -#include <sys/socket.h> #include <netinet/in.h> #include <protocols/talkd.h> + #include <curses.h> #include <signal.h> -#include <string.h> -#include <err.h> extern int sockt; extern int curses_initialized; |