devilhorns pushed a commit to branch master.

commit 3fb6ef5a83f5af12e2ba0c23caae2440a3104ba5
Author: Chris Michael <[email protected]>
Date:   Tue Jul 9 16:13:12 2013 +0100

    Fix compiler warnings
    - include unistd.h for close function.
    - initialize fd to -1 so we can check error condition.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/emotion/emotion_webcam.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lib/emotion/emotion_webcam.c b/src/lib/emotion/emotion_webcam.c
index 9b6d502..a0f81c7 100644
--- a/src/lib/emotion/emotion_webcam.c
+++ b/src/lib/emotion/emotion_webcam.c
@@ -3,6 +3,7 @@
 #endif
 
 #ifdef HAVE_EEZE
+# include <unistd.h>
 # include <sys/types.h>
 # include <sys/stat.h>
 # include <fcntl.h>
@@ -95,7 +96,7 @@ _emotion_check_device(Emotion_Webcam *ew)
    Emotion_Webcam *check;
    Eina_List *l;
    struct v4l2_capability caps;
-   int fd;
+   int fd = -1;
 #endif
 
    if (!ew) return;
@@ -133,7 +134,9 @@ _emotion_check_device(Emotion_Webcam *ew)
    eina_stringshare_del(ew->device);
    eina_stringshare_del(ew->name);
    free(ew);
+#ifdef HAVE_V4L2
    if (fd > 0) close(fd);
+#endif
 }
 
 static Emotion_Webcam *

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

Reply via email to