From 3fb6ef5a83f5af12e2ba0c23caae2440a3104ba5 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 9 Jul 2013 16:13:12 +0100 Subject: [PATCH] Fix compiler warnings - include unistd.h for close function. - initialize fd to -1 so we can check error condition. Signed-off-by: Chris Michael --- 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 9b6d502099..a0f81c74ca 100644 --- a/src/lib/emotion/emotion_webcam.c +++ b/src/lib/emotion/emotion_webcam.c @@ -3,6 +3,7 @@ #endif #ifdef HAVE_EEZE +# include # include # include # include @@ -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 *