]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/vfs/extattr.c
Fix fd handling on Solaris
[netatalk.git] / libatalk / vfs / extattr.c
index 6336980c2bd6aeb27fc2d06ae4b24920c0edef52..66f0b8c0c5b644b4e926a3c887c3b15399a1147a 100644 (file)
@@ -88,12 +88,12 @@ static const char *prefix(const char *uname)
 #endif
 }
 
-int sys_getxattrfd(const char *path, const char *uname, int oflag, ...)
+int sys_getxattrfd(int fd, const char *uname, int oflag, ...)
 {
 #if defined HAVE_ATTROPEN
     int eafd;
     va_list args;
-    mode_t mode;
+    mode_t mode = 0;
 
     if (oflag & O_CREAT) {
         va_start(args, oflag);
@@ -102,9 +102,9 @@ int sys_getxattrfd(const char *path, const char *uname, int oflag, ...)
     }
 
     if (oflag & O_CREAT)
-        eafd = attropen(path, uname, oflag, mode);
+        eafd = solaris_openat(fd, uname, oflag | O_XATTR, mode);
     else
-        eafd = attropen(path, uname, oflag);
+        eafd = solaris_openat(fd, uname, oflag | O_XATTR, mode);
 
     return eafd;
 #else