From: Frank Lahm Date: Tue, 31 Jan 2012 11:37:43 +0000 (+0100) Subject: Creating EAs that existed on Solaris X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8db520735876dd1ef9b1d90de6b51f106025e53;hp=61e09782a5bec443fbc26a7c311a9801860a0866;p=netatalk.git Creating EAs that existed on Solaris --- diff --git a/libatalk/vfs/extattr.c b/libatalk/vfs/extattr.c index 66f0b8c0..c98b6ea1 100644 --- a/libatalk/vfs/extattr.c +++ b/libatalk/vfs/extattr.c @@ -866,24 +866,38 @@ static int solaris_unlinkat(int attrdirfd, const char *name) static int solaris_attropen(const char *path, const char *attrpath, int oflag, mode_t mode) { - int filedes = attropen(path, attrpath, oflag, mode); - if (filedes == -1) { - if (errno != ENOENT) + int filedes; + + if ((filedes = attropen(path, attrpath, oflag, mode)) == -1) { + switch (errno) { + case ENOENT: + case EEXIST: + break; + default: LOG(log_error, logtype_default, "attropen(\"%s\", ea:'%s'): %s", path, attrpath, strerror(errno)); - errno = ENOATTR; + errno = ENOATTR; + break; + } } return filedes; } static int solaris_openat(int fildes, const char *path, int oflag, mode_t mode) { - int filedes = openat(fildes, path, oflag, mode); - if (filedes == -1) { - if (errno != ENOENT) + int filedes; + + if ((filedes = openat(fildes, path, oflag, mode)) == -1) { + switch (errno) { + case ENOENT: + case EEXIST: + break; + default: LOG(log_error, logtype_default, "openat(\"%s\"): %s", path, strerror(errno)); - errno = ENOATTR; + errno = ENOATTR; + break; + } } return filedes; }