Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
604dbf6
)
Avoid a compiler warning about setting "len" without using it.
author
Wayne Davison
<wayned@samba.org>
Tue, 21 Nov 2006 08:37:06 +0000
(08:37 +0000)
committer
Wayne Davison
<wayned@samba.org>
Tue, 21 Nov 2006 08:37:06 +0000
(08:37 +0000)
syscall.c
patch
|
blob
|
blame
|
history
diff --git
a/syscall.c
b/syscall.c
index
aaf5962
..
4b74793
100644
(file)
--- 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;
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
#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)
if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0
|| (unlink(pathname) < 0 && errno != ENOENT)