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

Colin Patrick McCabe commented on HDFS-7360:
--------------------------------------------

{code}
164     INCLUDE(CheckCSourceCompiles)
165     CHECK_C_SOURCE_COMPILES("
166     #include <string.h>
167     
168     #ifdef _WIN32
169     #define strerror_r(errnum, buf, buflen) strerror_s((buf), (buflen), 
(errnum))
170     #endif
171     
172     int main(void) 
173     { 
174         int i = strerror_r(0, 0, 100);
175         return 0; 
176     }
177     " STRERROR_R_RETURN_INT)
{code}

This test isn't quite right.  C/C++ can easily coerce a {{char*}} into an 
{{int}} (or vice versa) and compile with an error.  There will be a warning, 
but STRERROR_R_RETURN_INT will still be set to true.  Instead, you should do 
the same thing we do with the {{terror}} function in libhdfs to make this work 
(or even just copy that function).

Anyway, that is an existing problem, not a new one.  The rest looks good.  +1

> Test libhdfs3 against MiniDFSCluster
> ------------------------------------
>
>                 Key: HDFS-7360
>                 URL: https://issues.apache.org/jira/browse/HDFS-7360
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: Haohui Mai
>            Assignee: Zhanwei Wang
>            Priority: Critical
>         Attachments: HDFS-7360-pnative.002.patch, HDFS-7360.patch
>
>
> Currently the branch has enough code to interact with HDFS servers. We should 
> test the code against MiniDFSCluster to ensure the correctness of the code.



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

Reply via email to