diff options
author | 2015-10-11 20:23:49 +0000 | |
---|---|---|
committer | 2015-10-11 20:23:49 +0000 | |
commit | e9bd15038d03da9cf122f415eea0029eda0acc88 (patch) | |
tree | bd11aa13c278d8f69b5f845740bfccbf754330d8 /usr.sbin/lpr/common_source/startdaemon.c | |
parent | Don't return errno from main() (diff) | |
download | wireguard-openbsd-e9bd15038d03da9cf122f415eea0029eda0acc88.tar.xz wireguard-openbsd-e9bd15038d03da9cf122f415eea0029eda0acc88.zip |
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/startdaemon.c')
-rw-r--r-- | usr.sbin/lpr/common_source/startdaemon.c | 4 |
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; |