From e0d99018aaab10b367bde40833afd496b3b9ee25 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 19 Oct 2017 16:08:20 -0400 Subject: [PATCH] Google code style, add a warning if no sd --- src/zm_stream.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/zm_stream.cpp b/src/zm_stream.cpp index c0b8701a2..2fd7666bb 100644 --- a/src/zm_stream.cpp +++ b/src/zm_stream.cpp @@ -77,17 +77,13 @@ void StreamBase::updateFrameRate( double fps ) Debug( 3, "aEFPS:%.2f, aFM:%d", effective_fps, frame_mod ); } -bool StreamBase::checkCommandQueue() -{ - if ( sd >= 0 ) - { +bool StreamBase::checkCommandQueue() { + if ( sd >= 0 ) { CmdMsg msg; memset( &msg, 0, sizeof(msg) ); int nbytes = recvfrom( sd, &msg, sizeof(msg), MSG_DONTWAIT, 0, 0 ); - if ( nbytes < 0 ) - { - if ( errno != EAGAIN ) - { + if ( nbytes < 0 ) { + if ( errno != EAGAIN ) { Fatal( "recvfrom(), errno = %d, error = %s", errno, strerror(errno) ); } } @@ -95,11 +91,12 @@ bool StreamBase::checkCommandQueue() //{ //Error( "Partial message received, expected %d bytes, got %d", sizeof(msg), nbytes ); //} - else - { + else { processCommand( &msg ); return( true ); } + } else { + Warning("No sd in checkCommandQueue, comms not open?"); } return( false ); }