summaryrefslogtreecommitdiff
path: root/usr.bin/talk
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2004-03-21 08:14:39 +0000
committerColin Percival <cperciva@FreeBSD.org>2004-03-21 08:14:39 +0000
commita616808417cdb86ff40f755e7715c826497a7710 (patch)
tree004e48f12060ae1e60bb8d5815e390f03caf1b68 /usr.bin/talk
parent64bf80ce1b809dfa6b6c3d342d6ad88177a8fbfe (diff)
downloadsrc-test-a616808417cdb86ff40f755e7715c826497a7710.tar.gz
src-test-a616808417cdb86ff40f755e7715c826497a7710.zip
1. Use socklen_t instead of int
2. Compare socket(2) return code to -1, not <= 0. Obtained from: OpenBSD rev. 1.9
Notes
Notes: svn path=/head/; revision=127263
Diffstat (limited to 'usr.bin/talk')
-rw-r--r--usr.bin/talk/ctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/talk/ctl.c b/usr.bin/talk/ctl.c
index 2597a4346c070..68b229c56e0ab 100644
--- a/usr.bin/talk/ctl.c
+++ b/usr.bin/talk/ctl.c
@@ -68,7 +68,7 @@ CTL_MSG msg;
void
open_sockt()
{
- int length;
+ socklen_t length;
(void)memset(&my_addr, 0, sizeof(my_addr));
my_addr.sin_family = AF_INET;
@@ -76,7 +76,7 @@ open_sockt()
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)
p_error("Bad socket");
if (bind(sockt, (struct sockaddr *)&my_addr, sizeof(my_addr)) != 0)
p_error("Binding local socket");
@@ -89,7 +89,7 @@ open_sockt()
void
open_ctl()
{
- int length;
+ socklen_t length;
(void)memset(&ctl_addr, 0, sizeof(ctl_addr));
ctl_addr.sin_family = AF_INET;
@@ -97,7 +97,7 @@ open_ctl()
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)
p_error("Bad socket");
if (bind(ctl_sockt,
(struct sockaddr *)&ctl_addr, sizeof(ctl_addr)) != 0)