[gegl] Fix check of mmap() return value



commit c5bffc2a466021f79e0841a7ac6d3f544b625930
Author: Mukund Sivaraman <muks banu com>
Date:   Thu Jul 29 15:50:49 2010 +0530

    Fix check of mmap() return value

 operations/external/v4lutils/v4lutils.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/operations/external/v4lutils/v4lutils.c b/operations/external/v4lutils/v4lutils.c
index 2fa9fa7..634efd7 100644
--- a/operations/external/v4lutils/v4lutils.c
+++ b/operations/external/v4lutils/v4lutils.c
@@ -377,7 +377,9 @@ int v4lmmap(v4ldevice *vd)
 {
 	if(v4lgetmbuf(vd)<0)
 		return -1;
-	if((vd->map = mmap(0, vd->mbuf.size, PROT_READ|PROT_WRITE, MAP_SHARED, vd->fd, 0)) < 0) {
+
+        vd->map = mmap(0, vd->mbuf.size, PROT_READ|PROT_WRITE, MAP_SHARED, vd->fd, 0);
+	if(vd->map == MAP_FAILED) {
 		v4lperror("v4lmmap:mmap");
 		return -1;
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]