Fix the "prevent" issue in sensor plugins RSA repos
authorTimo Toikkanen <timo.toikkanen@ixonos.com>
Thu, 24 Jan 2013 09:56:23 +0000 (11:56 +0200)
committerTelle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com>
Mon, 28 Jan 2013 07:26:30 +0000 (09:26 +0200)
Fix for TZSP-4919

Change-Id: I54aae30f83f54fce3a83ba4fead73d3cf1f9ee73

packaging/sf-plugins-bb.changes
src/baseprocessor.cpp
src/lightprocessor.cpp
src/proxiprocessor.cpp

index 41863fe..d381ead 100644 (file)
@@ -1,3 +1,7 @@
+* Thu Jan 24 2013 Timo Toikkanen <timo.toikkanen@ixonos.com> accepted/tizen_2.0/20130111.182103@acd54f7
+- Fix for TZSP-4919
+- Updating changelog
+
 * Fri Jan 10 2013 Telle-Tiia Pitkänen <telle-tiia.pitkanen@ixonos.com> submit/trunk/20121023.061641@daf1aa1
 - Adding LGPLv2.1 license information
 
index 8b905a8..faf8c51 100644 (file)
@@ -209,6 +209,7 @@ int BaseProcessor::get_struct_value(unsigned int struct_type , void *struct_valu
 
      if (!fill_values(struct_type, count, unit, accuracy)) {
           DbgPrint("Fill values returned false");
+          mValueMutex.unlock();
           return -3;
      }
 
@@ -231,7 +232,7 @@ int BaseProcessor::get_struct_value(unsigned int struct_type , void *struct_valu
 
 void* BaseProcessor::started(void *ctx)
 {
-     //DbgPrint("%p",(void *) ctx);
+     DbgPrint("");
      return ((BaseProcessor *) ctx)->started();
 }
 
@@ -272,7 +273,7 @@ void BaseProcessor::process_input_events(const std::vector<input_event*> &events
           case EV_REL:
           case EV_ABS:
                DbgPrint("%s sensor got input code %d value %d\n",mName.c_str(), event.code, event.value);
-               if (event.code >= 0 && event.code < sizeof(mValues)/sizeof(float))
+               if (event.code < sizeof(mValues)/sizeof(float))
                     mValues[event.code] = event.value;
                break;
 
@@ -390,7 +391,7 @@ const char *BaseProcessor::find_device_from_udev(const char *driver)
      udev_enumerate *enumerator = NULL;
      bool result = false;
      struct udev_list_entry *devices = NULL, *dev_list_entry = NULL;
-     const char *devicePath = NULL;
+     const char *devicePath = "";
 
      DbgPrint("");
 
@@ -467,8 +468,10 @@ bool BaseProcessor::writeToSysfs(const char *filename, const char *buffer, int c
                DbgPrint("Sysfs file entry opened");
                int writeCount = write(fd,buffer,count);
                if (writeCount == count) {
+                    close(fd);
                     return true;
                }
+               close(fd);
           }
      }
      DbgPrint("There was error opening sysfs file %s",strerror(errno));
index 58b09b8..2cec8d7 100644 (file)
@@ -132,9 +132,7 @@ void* LightProcessor::started()
      pollfd pollInfo;
      pollInfo.fd = mFd;
      pollInfo.events = POLLIN;
-     poll(&pollInfo,1,2000);
-
-     if (pollInfo.revents & POLLIN) {
+     if(poll(&pollInfo,1,2000)){
           DbgPrint("HAVE POLLIN");
           int value;
           int readCount = read(mFd,&value,sizeof(int));
index cb2f8b2..42b8a97 100644 (file)
@@ -99,10 +99,8 @@ void* ProxiProcessor::started()
      pollfd pollInfo;
      pollInfo.fd = mFd;
      pollInfo.events = POLLIN;
-     poll(&pollInfo,1,-1);
-     DbgPrint("Poll completed");
-
-     if (pollInfo.revents & POLLIN) {
+     if (poll(&pollInfo,1,-1)){
+          DbgPrint("Poll completed");
           int value;
           int result = read(mFd,&value,sizeof(int));
           if (result > 0) {