hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Isaacson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-3675) libhdfs: follow documented return codes
Date Wed, 18 Jul 2012 00:41:34 GMT

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

Andy Isaacson commented on HDFS-3675:
-------------------------------------

{code}
@@ -1866,18 +1868,18 @@ int hdfsChmod(hdfsFS fs, const char* path, short mode)
     jobject jPermObj =
       constructNewObjectOfClass(env, NULL, HADOOP_FSPERM,"(S)V",jmode);
     if (jPermObj == NULL) {
-      return -2;
+      ret = EINTERNAL;
+      return -1;
{code}

I think that should be "errno = EINTERNAL"?  It doesn't make sense to assign to the local
variable "ret" immediately before returning.

Other than that, this looks fine.  I'm not sure moving the "ret=0" down from around line 1872
to around 1889 is a win, but it's not a problem either.
                
> libhdfs: follow documented return codes
> ---------------------------------------
>
>                 Key: HDFS-3675
>                 URL: https://issues.apache.org/jira/browse/HDFS-3675
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: libhdfs
>    Affects Versions: 2.0.1-alpha
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>         Attachments: HDFS-3675.001.patch
>
>
> libhdfs should follow its own documentation for return codes.  This means always setting
errno, and in most cases returning -1 (not some other value) on error.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message