summaryrefslogtreecommitdiff
path: root/src/lib/emotion/emotion_webcam.c
diff options
context:
space:
mode:
authorChris Michael <devilhorns@comcast.net>2013-07-09 16:13:12 +0100
committerChris Michael <devilhorns@comcast.net>2013-07-09 16:13:12 +0100
commit3fb6ef5a83f5af12e2ba0c23caae2440a3104ba5 (patch)
tree915ac71d9efc388dc69a4ddf1c2db5a2610f8f20 /src/lib/emotion/emotion_webcam.c
parent5f3a2dd5f6bd2cfb9e25e12535b692fff1cdb009 (diff)
Fix compiler warnings
- include unistd.h for close function. - initialize fd to -1 so we can check error condition. Signed-off-by: Chris Michael <devilhorns@comcast.net>
Diffstat (limited to '')
-rw-r--r--src/lib/emotion/emotion_webcam.c5
1 files changed, 4 insertions, 1 deletions
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 @@
3#endif 3#endif
4 4
5#ifdef HAVE_EEZE 5#ifdef HAVE_EEZE
6# include <unistd.h>
6# include <sys/types.h> 7# include <sys/types.h>
7# include <sys/stat.h> 8# include <sys/stat.h>
8# include <fcntl.h> 9# include <fcntl.h>
@@ -95,7 +96,7 @@ _emotion_check_device(Emotion_Webcam *ew)
95 Emotion_Webcam *check; 96 Emotion_Webcam *check;
96 Eina_List *l; 97 Eina_List *l;
97 struct v4l2_capability caps; 98 struct v4l2_capability caps;
98 int fd; 99 int fd = -1;
99#endif 100#endif
100 101
101 if (!ew) return; 102 if (!ew) return;
@@ -133,7 +134,9 @@ _emotion_check_device(Emotion_Webcam *ew)
133 eina_stringshare_del(ew->device); 134 eina_stringshare_del(ew->device);
134 eina_stringshare_del(ew->name); 135 eina_stringshare_del(ew->name);
135 free(ew); 136 free(ew);
137#ifdef HAVE_V4L2
136 if (fd > 0) close(fd); 138 if (fd > 0) close(fd);
139#endif
137} 140}
138 141
139static Emotion_Webcam * 142static Emotion_Webcam *