Bug 5141 - version 3.0.28 does not compile on solaris 9
Summary: version 3.0.28 does not compile on solaris 9
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.27
Hardware: Sparc Solaris
: P3 normal
Target Milestone: none
Assignee: Tim Potter
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-14 04:58 UTC by Hans Mayer
Modified: 2007-12-14 18:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Mayer 2007-12-14 04:58:07 UTC
the problem occours only with solaris 9 
gcc version 2.95.3 20010315 
not with solaris 10 - higher gcc versions 

the following patch resolves the problem 


*** system.c_orig       Thu Nov 15 04:15:03 2007
--- system.c    Fri Dec 14 11:45:46 2007
***************
*** 2161,2169 ****
  #elif defined(HAVE_ATTROPEN)
        int ret = -1;
        int myflags = O_RDWR;
        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);
        if (attrfd >= 0) {
                ret = solaris_write_xattr(attrfd, value, size);
                close(attrfd);
--- 2161,2170 ----
  #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;
!       attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE);
        if (attrfd >= 0) {
                ret = solaris_write_xattr(attrfd, value, size);
                close(attrfd);
***************
*** 2224,2232 ****
  #elif defined(HAVE_ATTROPEN)
        int ret = -1;
        int myflags = O_RDWR | AT_SYMLINK_NOFOLLOW;
        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);
        if (attrfd >= 0) {
                ret = solaris_write_xattr(attrfd, value, size);
                close(attrfd);
--- 2225,2234 ----
  #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;
!       attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE);
        if (attrfd >= 0) {
                ret = solaris_write_xattr(attrfd, value, size);
                close(attrfd);
***************
*** 2288,2296 ****
  #elif defined(HAVE_ATTROPEN)
        int ret = -1;
        int myflags = O_RDWR | O_XATTR;
        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);
        if (attrfd >= 0) {
                ret = solaris_write_xattr(attrfd, value, size);
                close(attrfd);
--- 2290,2299 ----
  #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;
!       attrfd = solaris_openat(filedes, name, myflags, (mode_t) SOLARIS_ATTRMODE);
        if (attrfd >= 0) {
                ret = solaris_write_xattr(attrfd, value, size);
                close(attrfd);
Comment 1 Jeremy Allison 2007-12-14 18:33:24 UTC
Applied for 3.0.28a. Thanks.
Jeremy.