[lib-result] Do not perror() if owl_run is false
owl_receive_position() do not print the error message when owl_run is false. This is to avoid an error message when a program is stopped.
This commit is contained in:
parent
632858155a
commit
8cc05d718c
|
@ -13,10 +13,13 @@
|
||||||
/*
|
/*
|
||||||
* Receives a result from the socket of file descriptor 'sockfd', fills
|
* Receives a result from the socket of file descriptor 'sockfd', fills
|
||||||
* an owl_result structure with the received information, and returns a
|
* an owl_result structure with the received information, and returns a
|
||||||
* pointer to it (or NULL in case of error).
|
* pointer to it.
|
||||||
*
|
*
|
||||||
* Note that the new owl_result is allocated with malloc() and must be
|
* Note that the new owl_result is allocated with malloc() and must be
|
||||||
* deleted using free().
|
* deleted using free().
|
||||||
|
*
|
||||||
|
* In case of error, a message is printed, except if owl_run (from
|
||||||
|
* libowlps) is false, and NULL is returned.
|
||||||
*/
|
*/
|
||||||
owl_result* owl_receive_position(int sockfd)
|
owl_result* owl_receive_position(int sockfd)
|
||||||
{
|
{
|
||||||
|
@ -28,7 +31,8 @@ owl_result* owl_receive_position(int sockfd)
|
||||||
|
|
||||||
if (nread <= 0)
|
if (nread <= 0)
|
||||||
{
|
{
|
||||||
perror("No request received from listener") ;
|
if (owl_run)
|
||||||
|
perror("No request received from listener") ;
|
||||||
return NULL ;
|
return NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue