Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
OK, let's try that again.
[fs/lustre-release.git]
/
libsysio
/
src
/
readlink.c
diff --git
a/libsysio/src/readlink.c
b/libsysio/src/readlink.c
index
8693dc3
..
f083744
100644
(file)
--- a/
libsysio/src/readlink.c
+++ b/
libsysio/src/readlink.c
@@
-41,21
+41,21
@@
* lee@sandia.gov
*/
* lee@sandia.gov
*/
-#if defined(__linux__)
-#define _BSD_SOURCE
-#endif
#include <unistd.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <assert.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/queue.h>
#include "sysio.h"
#include "inode.h"
#include "sysio-symbols.h"
#include <sys/queue.h>
#include "sysio.h"
#include "inode.h"
#include "sysio-symbols.h"
+#ifdef HAVE_POSIX_1003_READLINK
+ssize_t
+#else
int
int
+#endif
SYSIO_INTERFACE_NAME(readlink)(const char *path, char *buf, size_t bufsiz)
{
struct intent intent;
SYSIO_INTERFACE_NAME(readlink)(const char *path, char *buf, size_t bufsiz)
{
struct intent intent;
@@
-70,15
+70,14
@@
SYSIO_INTERFACE_NAME(readlink)(const char *path, char *buf, size_t bufsiz)
if (err)
goto out;
ino = pno->p_base->pb_ino;
if (err)
goto out;
ino = pno->p_base->pb_ino;
- if (!S_ISLNK(ino->i_stbuf.st_mode)) {
- err = -EINVAL;
- goto error;
- }
err = (*ino->i_ops.inop_readlink)(pno, buf, bufsiz);
err = (*ino->i_ops.inop_readlink)(pno, buf, bufsiz);
+ if (err)
+ goto error;
+
error:
P_RELE(pno);
out:
error:
P_RELE(pno);
out:
- SYSIO_INTERFACE_RETURN(err
< 0 ? -1 : err
, err >= 0 ? 0 : err);
+ SYSIO_INTERFACE_RETURN(err, err >= 0 ? 0 : err);
}
#ifdef REDSTORM
}
#ifdef REDSTORM