summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-03-02 21:04:43 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-03-02 21:04:43 +0000
commitf4398f332bba1ad26f38a9f91f86877aa8637b1e (patch)
treeb8b8f58ffabdea68ace2639461779be3e7daa785 /usr.bin
parented451dcd19fb7bc912e368b685cd47aea96901f4 (diff)
use socklen_t and better socket() checks. from Andrey Matveev
-Wall for good measure
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/talk/ctl.c12
-rw-r--r--usr.bin/talk/ctl_transact.c4
-rw-r--r--usr.bin/talk/display.c4
-rw-r--r--usr.bin/talk/get_addrs.c4
-rw-r--r--usr.bin/talk/get_names.c4
-rw-r--r--usr.bin/talk/init_disp.c4
-rw-r--r--usr.bin/talk/invite.c8
-rw-r--r--usr.bin/talk/io.c4
-rw-r--r--usr.bin/talk/look_up.c4
-rw-r--r--usr.bin/talk/msgs.c4
-rw-r--r--usr.bin/talk/talk.c6
11 files changed, 29 insertions, 29 deletions
diff --git a/usr.bin/talk/ctl.c b/usr.bin/talk/ctl.c
index 08cc69e6f50..558730679ae 100644
--- a/usr.bin/talk/ctl.c
+++ b/usr.bin/talk/ctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctl.c,v 1.8 2003/06/10 22:20:52 deraadt Exp $ */
+/* $OpenBSD: ctl.c,v 1.9 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: ctl.c,v 1.3 1994/12/09 02:14:10 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)ctl.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: ctl.c,v 1.8 2003/06/10 22:20:52 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: ctl.c,v 1.9 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
/*
@@ -66,12 +66,12 @@ CTL_MSG msg;
void
open_sockt(void)
{
- int length;
+ socklen_t length;
my_addr.sin_addr = my_machine_addr;
my_addr.sin_port = 0;
sockt = socket(AF_INET, SOCK_STREAM, 0);
- if (sockt <= 0)
+ if (sockt == -1)
quit("Bad socket", 1);
if (bind(sockt, (struct sockaddr *)&my_addr, sizeof(my_addr)) != 0)
quit("Binding local socket", 1);
@@ -84,12 +84,12 @@ open_sockt(void)
void
open_ctl(void)
{
- int length;
+ socklen_t length;
ctl_addr.sin_port = 0;
ctl_addr.sin_addr = my_machine_addr;
ctl_sockt = socket(AF_INET, SOCK_DGRAM, 0);
- if (ctl_sockt <= 0)
+ if (ctl_sockt == -1)
quit("Bad socket", 1);
if (bind(ctl_sockt,
(struct sockaddr *)&ctl_addr, sizeof(ctl_addr)) != 0)
diff --git a/usr.bin/talk/ctl_transact.c b/usr.bin/talk/ctl_transact.c
index 9e84e16fbc2..6892b59b603 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.9 2003/08/11 21:10:54 deraadt Exp $ */
+/* $OpenBSD: ctl_transact.c,v 1.10 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: ctl_transact.c,v 1.3 1994/12/09 02:14:12 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)ctl_transact.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: ctl_transact.c,v 1.9 2003/08/11 21:10:54 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: ctl_transact.c,v 1.10 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
#include "talk.h"
diff --git a/usr.bin/talk/display.c b/usr.bin/talk/display.c
index ea212f31315..a82778f7b26 100644
--- a/usr.bin/talk/display.c
+++ b/usr.bin/talk/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.13 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: display.c,v 1.14 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: display.c,v 1.3 1994/12/09 02:14:13 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)display.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: display.c,v 1.13 2003/06/03 02:56:17 millert Exp $";
+static const char rcsid[] = "$OpenBSD: display.c,v 1.14 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
/*
diff --git a/usr.bin/talk/get_addrs.c b/usr.bin/talk/get_addrs.c
index ed00281a131..3d2abf409c8 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.5 2003/06/03 02:56:17 millert Exp $ */
+/* $OpenBSD: get_addrs.c,v 1.6 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: get_addrs.c,v 1.3 1994/12/09 02:14:14 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)get_addrs.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: get_addrs.c,v 1.5 2003/06/03 02:56:17 millert Exp $";
+static const char rcsid[] = "$OpenBSD: get_addrs.c,v 1.6 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
#include "talk.h"
diff --git a/usr.bin/talk/get_names.c b/usr.bin/talk/get_names.c
index 944a7f606c7..5ec905993c0 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.14 2003/10/01 06:32:44 deraadt Exp $ */
+/* $OpenBSD: get_names.c,v 1.15 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: get_names.c,v 1.4 1994/12/09 02:14:16 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)get_names.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: get_names.c,v 1.14 2003/10/01 06:32:44 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: get_names.c,v 1.15 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
#include "talk.h"
diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c
index f31dc76362e..c72872fd1c0 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.18 2003/07/10 00:06:51 david Exp $ */
+/* $OpenBSD: init_disp.c,v 1.19 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: init_disp.c,v 1.6 1994/12/09 02:14:17 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)init_disp.c 8.2 (Berkeley) 2/16/94";
#endif
-static char rcsid[] = "$OpenBSD: init_disp.c,v 1.18 2003/07/10 00:06:51 david Exp $";
+static const char rcsid[] = "$OpenBSD: init_disp.c,v 1.19 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
/*
diff --git a/usr.bin/talk/invite.c b/usr.bin/talk/invite.c
index e143fc211c5..9703d172515 100644
--- a/usr.bin/talk/invite.c
+++ b/usr.bin/talk/invite.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: invite.c,v 1.11 2003/09/26 04:41:48 deraadt Exp $ */
+/* $OpenBSD: invite.c,v 1.12 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: invite.c,v 1.3 1994/12/09 02:14:18 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)invite.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: invite.c,v 1.11 2003/09/26 04:41:48 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: invite.c,v 1.12 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
#include "talk.h"
@@ -70,7 +70,7 @@ invite_remote(void)
struct itimerval itimer;
CTL_RESPONSE response;
struct sockaddr rp;
- int rplen = sizeof(struct sockaddr);
+ socklen_t rplen = sizeof(struct sockaddr);
struct hostent *rphost;
char rname[STRING_LENGTH];
@@ -101,7 +101,7 @@ invite_remote(void)
message("Waiting for your party to respond");
signal(SIGALRM, re_invite);
(void) setjmp(invitebuf);
- while ((new_sockt = accept(sockt, &rp, &rplen)) < 0) {
+ while ((new_sockt = accept(sockt, &rp, &rplen)) == -1) {
if (errno == EINTR || errno == ECONNABORTED)
continue;
quit("Unable to connect with your party", 1);
diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c
index 9734bc13311..f23558222e7 100644
--- a/usr.bin/talk/io.c
+++ b/usr.bin/talk/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.14 2003/08/11 21:10:54 deraadt Exp $ */
+/* $OpenBSD: io.c,v 1.15 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: io.c,v 1.4 1994/12/09 02:14:20 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: io.c,v 1.14 2003/08/11 21:10:54 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: io.c,v 1.15 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
/*
diff --git a/usr.bin/talk/look_up.c b/usr.bin/talk/look_up.c
index 2174907ab89..472fc3813c2 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.9 2003/06/10 22:20:53 deraadt Exp $ */
+/* $OpenBSD: look_up.c,v 1.10 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: look_up.c,v 1.3 1994/12/09 02:14:21 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)look_up.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: look_up.c,v 1.9 2003/06/10 22:20:53 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: look_up.c,v 1.10 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
#include "talk.h"
diff --git a/usr.bin/talk/msgs.c b/usr.bin/talk/msgs.c
index 897da974c54..8fdd47ea840 100644
--- a/usr.bin/talk/msgs.c
+++ b/usr.bin/talk/msgs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msgs.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $ */
+/* $OpenBSD: msgs.c,v 1.8 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: msgs.c,v 1.3 1994/12/09 02:14:22 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)msgs.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: msgs.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: msgs.c,v 1.8 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
/*
diff --git a/usr.bin/talk/talk.c b/usr.bin/talk/talk.c
index e21df863f16..afa415926a1 100644
--- a/usr.bin/talk/talk.c
+++ b/usr.bin/talk/talk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: talk.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $ */
+/* $OpenBSD: talk.c,v 1.8 2004/03/02 21:04:42 tedu Exp $ */
/* $NetBSD: talk.c,v 1.3 1994/12/09 02:14:25 jtc Exp $ */
/*
@@ -31,7 +31,7 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)talk.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: talk.c,v 1.7 2003/06/10 22:20:53 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: talk.c,v 1.8 2004/03/02 21:04:42 tedu Exp $";
#endif /* not lint */
#include "talk.h"