It's either a read error or a read of an invalid number of bytes
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 24 May 2014 16:25:36 +0000 (17:25 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 24 May 2014 16:29:11 +0000 (17:29 +0100)
src/main/detail.c

index f1972b8..7c70991 100644 (file)
@@ -818,9 +818,9 @@ void detail_free(rad_listen_t *this)
                ret = read(data->master_pipe[0], &arg, sizeof(arg));
                if (ret < 0) {
                        ERROR("Reader thread exited without informing the master: %s", fr_syserror(errno));
-               }
-               if (ret != sizeof(arg)) {
+               } else if (ret != sizeof(arg)) {
                        ERROR("Invalid thread pointer received from reader thread during exit");
+                       ERROR("Expected %zu bytes, got %zi bytes", sizeof(arg), ret);
                }
 
                close(data->master_pipe[0]);