summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/common_source
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-10-11 20:23:50 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-10-11 20:23:50 +0000
commit28b23bc49f2cfdf5f33300636bf3a1e27cedc637 (patch)
tree530be54585dba4d94b79ac7f53d4a1ad0a435caa /usr.sbin/lpr/common_source
parent45f71ffce4de585efba855a1f33f1565ba39ad46 (diff)
Userspace doesn't need to use SUN_LEN(): connect() and bind() must accept
sizeof(struct sockaddr_un), so do the simple, portable thing. Also convert some strncpy() to strlcpy() ok deraadt@
Diffstat (limited to 'usr.sbin/lpr/common_source')
-rw-r--r--usr.sbin/lpr/common_source/startdaemon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/lpr/common_source/startdaemon.c b/usr.sbin/lpr/common_source/startdaemon.c
index 84988f3e3ed..ca4acf98922 100644
--- a/usr.sbin/lpr/common_source/startdaemon.c
+++ b/usr.sbin/lpr/common_source/startdaemon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: startdaemon.c,v 1.15 2015/01/16 06:40:17 deraadt Exp $ */
+/* $OpenBSD: startdaemon.c,v 1.16 2015/10/11 20:23:49 guenther Exp $ */
/* $NetBSD: startdaemon.c,v 1.10 1998/07/18 05:04:39 lukem Exp $ */
/*
@@ -66,7 +66,7 @@ startdaemon(char *printer)
strlcpy(un.sun_path, _PATH_SOCKETNAME, sizeof(un.sun_path));
siginterrupt(SIGINT, 1);
PRIV_START;
- if (connect(s, (struct sockaddr *)&un, SUN_LEN(&un)) < 0) {
+ if (connect(s, (struct sockaddr *)&un, sizeof(un)) < 0) {
int saved_errno = errno;
if (errno == EINTR && gotintr) {
PRIV_END;