[ 
https://issues.apache.org/jira/browse/AXIS2C-1337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12668471#action_12668471
 ] 

Soren Hansen commented on AXIS2C-1337:
--------------------------------------

You should use perror instead of "fprintf(stderr, ...". It resolves the errno 
to a (localised, even) error message.

Regarding the patch against tcpmon, fread returning less than the requested 
number of bytes is not necessarily a fatal error. The system call might simply 
have been interrupted, in which case you should simply try again. In other 
words, you should check for errno == EINTR
.


> Fails to compile if chdir and/or fread declared with warn_unused_result
> -----------------------------------------------------------------------
>
>                 Key: AXIS2C-1337
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1337
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: tcpmon, util
>    Affects Versions: 1.5.0
>         Environment: Ubuntu 9.04 (pre-release)
>            Reporter: Soren Hansen
>         Attachments: axis2c-warn_unused.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> axis2c fails to compile on Ubuntu 9.04, due to two things:
> In util/src/dir_handler.c, AXIS2_CHDIR's return value is ignored. chdir is 
> declared with warn_unused_result in our toolchain, and you pass -Werror to 
> gcc, so this causes a build failure. Obvisouly, chdir could fail for a number 
> of reasons, and failing to check is a problem.
> The same problem exists in tools/tcpmon/src/tcpmon.c, where the return value 
> of fread is ignored.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to