[ 
https://issues.apache.org/jira/browse/HDFS-10511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331770#comment-15331770
 ] 

Anatoli Shein commented on HDFS-10511:
--------------------------------------

Thanks, [~bobhansen]. I have fixed everything, but I ran into one issue:

In hdfs.h in all function descriptions it looks like all functions are 
consistently 0 on success and -1 on failure, except for 3 functions:
hdfsBuilderConfSetStr
hdfsConfGetStr
hdfsConfGetInt
    These 3 functions are specified to return nonzero error code on failure. 
Since we are trying to be consistent in hdfspp and have all functions return -1 
on error, I changed these hdfs.h function descriptions to have this:
     ...
     * @return         (in libhdfs)   0 on success; nonzero error code 
otherwise.
     *                 (in libhdfspp) 0 on success; -1 otherwise.
     ...
And in libhdfspp these functions do return -1 on failure.
Please let me know if this is okay.

> libhdfs++: make error returning mechanism consistent across all hdfs 
> operations
> -------------------------------------------------------------------------------
>
>                 Key: HDFS-10511
>                 URL: https://issues.apache.org/jira/browse/HDFS-10511
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: Anatoli Shein
>            Assignee: Anatoli Shein
>         Attachments: HDFS-10511.HDFS-8707.000.patch, 
> HDFS-10511.HDFS-8707.000.patch
>
>
> Errno should always be set.
> If function is returning a code on stack, it should be consistent with errno.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to