From: Wayne Davison Date: Tue, 21 Nov 2006 08:37:06 +0000 (+0000) Subject: Avoid a compiler warning about setting "len" without using it. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/4f3755923230c66e8dd3b2ff36d6f554cf18e131 Avoid a compiler warning about setting "len" without using it. --- diff --git a/syscall.c b/syscall.c index aaf59626..4b747933 100644 --- a/syscall.c +++ b/syscall.c @@ -87,14 +87,15 @@ int do_mknod(const char *pathname, mode_t mode, dev_t dev) if (S_ISSOCK(mode)) { int sock; struct sockaddr_un saddr; - unsigned int len; - - saddr.sun_family = AF_UNIX; - len = strlcpy(saddr.sun_path, pathname, sizeof saddr.sun_path); +#ifdef HAVE_SOCKADDR_UN_LEN + unsigned int len = +#endif + strlcpy(saddr.sun_path, pathname, sizeof saddr.sun_path); #ifdef HAVE_SOCKADDR_UN_LEN saddr.sun_len = len >= sizeof saddr.sun_path ? sizeof saddr.sun_path : len + 1; #endif + saddr.sun_family = AF_UNIX; if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0 || (unlink(pathname) < 0 && errno != ENOENT)