[Spice-devel,v2,6/6] dispatcher: write_safe: move EINTR debug message

Submitted by Uri Lublin on Dec. 6, 2016, 4:06 p.m.

Details

Message ID 20161206160631.30624-7-uril@redhat.com
State Accepted
Commit 51d0ed6abb8d0d8ea2434431815a6d9b4e85f109
Headers show
Series "More coverity fixes" ( rev: 3 ) in Spice

Not browsing as part of any series.

Commit Message

Uri Lublin Dec. 6, 2016, 4:06 p.m.
spice_debug was called for not-EINTR case, move
it to the right place.

Signed-off-by: Uri Lublin <uril@redhat.com>
---
 server/dispatcher.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/server/dispatcher.c b/server/dispatcher.c
index f0479aa..f4fe97b 100644
--- a/server/dispatcher.c
+++ b/server/dispatcher.c
@@ -254,9 +254,9 @@  static int write_safe(int fd, uint8_t *buf, size_t size)
         ret = write(fd, buf + written_size, size - written_size);
         if (ret == -1) {
             if (errno != EINTR) {
-                spice_debug("EINTR in write");
                 return -1;
             }
+            spice_debug("EINTR in write");
             continue;
         }
         written_size += ret;

Comments

> 
> spice_debug was called for not-EINTR case, move
> it to the right place.
> 
> Signed-off-by: Uri Lublin <uril@redhat.com>
> ---
>  server/dispatcher.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/dispatcher.c b/server/dispatcher.c
> index f0479aa..f4fe97b 100644
> --- a/server/dispatcher.c
> +++ b/server/dispatcher.c
> @@ -254,9 +254,9 @@ static int write_safe(int fd, uint8_t *buf, size_t size)
>          ret = write(fd, buf + written_size, size - written_size);
>          if (ret == -1) {
>              if (errno != EINTR) {
> -                spice_debug("EINTR in write");
>                  return -1;
>              }
> +            spice_debug("EINTR in write");
>              continue;
>          }
>          written_size += ret;

Acked-by: Frediano Ziglio <fziglio@redhat.com>

Frediano