[
https://issues.apache.org/jira/browse/HDFS-8407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14563533#comment-14563533
]
Hudson commented on HDFS-8407:
------------------------------
FAILURE: Integrated in Hadoop-trunk-Commit #7919 (See
[https://builds.apache.org/job/Hadoop-trunk-Commit/7919/])
HDFS-8407. libhdfs hdfsListDirectory must set errno to 0 on success (Masatake
Iwasaki via Colin P. McCabe) (cmccabe: rev
d2d95bfe886a7fdf9d58fd5c47ec7c0158393afb)
* hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/expect.h
*
hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test_libhdfs_threaded.c
*
hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/test/test_libhdfs_ops.c
* hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
* hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.h
* hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/hdfs.c
> hdfsListDirectory must set errno to 0 on success
> ------------------------------------------------
>
> Key: HDFS-8407
> URL: https://issues.apache.org/jira/browse/HDFS-8407
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: HDFS
> Reporter: Juan Yu
> Assignee: Masatake Iwasaki
> Fix For: 2.8.0
>
> Attachments: HDFS-8407.001.patch, HDFS-8407.002.patch,
> HDFS-8407.003.patch
>
>
> The documentation says it returns NULL on error, but it could also return
> NULL when the directory is empty.
> /**
> * hdfsListDirectory - Get list of files/directories for a given
> * directory-path. hdfsFreeFileInfo should be called to deallocate
> memory.
> * @param fs The configured filesystem handle.
> * @param path The path of the directory.
> * @param numEntries Set to the number of files/directories in path.
> * @return Returns a dynamically-allocated array of hdfsFileInfo
> * objects; NULL on error.
> */
> {code}
> hdfsFileInfo *pathList = NULL;
> ...
> //Figure out the number of entries in that directory
> jPathListSize = (*env)->GetArrayLength(env, jPathList);
> if (jPathListSize == 0) {
> ret = 0;
> goto done;
> }
> ...
> if (ret) {
> hdfsFreeFileInfo(pathList, jPathListSize);
> errno = ret;
> return NULL;
> }
> *numEntries = jPathListSize;
> return pathList;
> {code}
> Either change the implementation to match the doc, or fix the doc to match
> the implementation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)