From 02571885a91c83c64cc894070f5c15bde81620b5 Mon Sep 17 00:00:00 2001 From: Tomoki AONO Date: Sun, 25 Nov 2007 01:59:40 +0900 Subject: 1. lib/system.c (xattr code for Solaris) could not be built against c90 compilers. (declaration after statement.) Sample patch attached. (This used to be commit 102a247df99967f25dbaf40c9be2d48a8e15c64c) --- source3/lib/system.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source3/lib/system.c b/source3/lib/system.c index 7338ea7750..5013cc53e8 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -1990,9 +1990,10 @@ int sys_setxattr (const char *path, const char *name, const void *value, size_t #elif defined(HAVE_ATTROPEN) int ret = -1; int myflags = O_RDWR; + int attrfd; if (flags & XATTR_CREATE) myflags |= O_EXCL; if (!(flags & XATTR_REPLACE)) myflags |= O_CREAT; - int attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE); + attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE); if (attrfd >= 0) { ret = solaris_write_xattr(attrfd, value, size); close(attrfd); @@ -2053,9 +2054,10 @@ int sys_lsetxattr (const char *path, const char *name, const void *value, size_t #elif defined(HAVE_ATTROPEN) int ret = -1; int myflags = O_RDWR | AT_SYMLINK_NOFOLLOW; + int attrfd; if (flags & XATTR_CREATE) myflags |= O_EXCL; if (!(flags & XATTR_REPLACE)) myflags |= O_CREAT; - int attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE); + attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE); if (attrfd >= 0) { ret = solaris_write_xattr(attrfd, value, size); close(attrfd); @@ -2117,9 +2119,10 @@ int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size #elif defined(HAVE_ATTROPEN) int ret = -1; int myflags = O_RDWR | O_XATTR; + int attrfd; if (flags & XATTR_CREATE) myflags |= O_EXCL; if (!(flags & XATTR_REPLACE)) myflags |= O_CREAT; - int attrfd = solaris_openat(filedes, name, myflags, (mode_t) SOLARIS_ATTRMODE); + attrfd = solaris_openat(filedes, name, myflags, (mode_t) SOLARIS_ATTRMODE); if (attrfd >= 0) { ret = solaris_write_xattr(attrfd, value, size); close(attrfd); -- cgit