diff options
author | Brent Cook <bcook@cvs.openbsd.org> | 2015-01-04 01:24:44 +0000 |
---|---|---|
committer | Brent Cook <bcook@cvs.openbsd.org> | 2015-01-04 01:24:44 +0000 |
commit | 8790f1b7a4875aaa4c14cb63e03f77a5d75ffe75 (patch) | |
tree | c113ff7b3c53ae3f4c555e76c91ba034b6476909 /usr.sbin/ntpd/control.c | |
parent | 5516b38d65c744b087257e6d998e12c311f42026 (diff) |
rename sockaddr_un variables from 'sun' to the more common 'sa'.
This avoids a namespace conflict with Solaris build environments.
discussed with deraadt@ and kettenis@
Diffstat (limited to 'usr.sbin/ntpd/control.c')
-rw-r--r-- | usr.sbin/ntpd/control.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/ntpd/control.c b/usr.sbin/ntpd/control.c index 88dc791377a..e5af00f0cc3 100644 --- a/usr.sbin/ntpd/control.c +++ b/usr.sbin/ntpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.2 2013/11/13 20:44:39 benno Exp $ */ +/* $OpenBSD: control.c,v 1.3 2015/01/04 01:24:43 bcook Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -36,7 +36,7 @@ int control_init(char *path) { - struct sockaddr_un sun; + struct sockaddr_un sa; int fd; mode_t old_umask; @@ -45,10 +45,10 @@ control_init(char *path) return (-1); } - bzero(&sun, sizeof(sun)); - sun.sun_family = AF_UNIX; - if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >= - sizeof(sun.sun_path)) + bzero(&sa, sizeof(sa)); + sa.sun_family = AF_UNIX; + if (strlcpy(sa.sun_path, path, sizeof(sa.sun_path)) >= + sizeof(sa.sun_path)) errx(1, "ctl socket name too long"); if (unlink(path) == -1) @@ -59,7 +59,7 @@ control_init(char *path) } old_umask = umask(S_IXUSR|S_IXGRP|S_IWOTH|S_IROTH|S_IXOTH); - if (bind(fd, (struct sockaddr *)&sun, sizeof(sun)) == -1) { + if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) { log_warn("control_init: bind: %s", path); close(fd); umask(old_umask); @@ -108,12 +108,12 @@ control_accept(int listenfd) { int connfd; socklen_t len; - struct sockaddr_un sun; + struct sockaddr_un sa; struct ctl_conn *ctl_conn; - len = sizeof(sun); + len = sizeof(sa); if ((connfd = accept(listenfd, - (struct sockaddr *)&sun, &len)) == -1) { + (struct sockaddr *)&sa, &len)) == -1) { if (errno != EWOULDBLOCK && errno != EINTR) log_warn("control_accept: accept"); return (0); |