[haiku-commits] r40907 - haiku/trunk/src/add-ons/kernel/drivers/network/wimax/usb_beceemwmx

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 10 Mar 2011 22:44:37 +0100 (CET)

Author: kallisti5
Date: 2011-03-10 22:44:36 +0100 (Thu, 10 Mar 2011)
New Revision: 40907
Changeset: http://dev.haiku-os.org/changeset/40907

Modified:
   
haiku/trunk/src/add-ons/kernel/drivers/network/wimax/usb_beceemwmx/Settings.cpp
Log:
fix another possible passing of unsigned int into a function requiring a signed 
int, CID 10665

Modified: 
haiku/trunk/src/add-ons/kernel/drivers/network/wimax/usb_beceemwmx/Settings.cpp
===================================================================
--- 
haiku/trunk/src/add-ons/kernel/drivers/network/wimax/usb_beceemwmx/Settings.cpp 
    2011-03-10 21:21:54 UTC (rev 40906)
+++ 
haiku/trunk/src/add-ons/kernel/drivers/network/wimax/usb_beceemwmx/Settings.cpp 
    2011-03-10 21:44:36 UTC (rev 40907)
@@ -117,9 +117,13 @@
        }
 
        mutex_lock(&gLogLock);
-       int fd = open(gLogFilePath, O_WRONLY | O_APPEND);
-       write(fd, buffer, strlen(buffer));
-       close(fd);
+       int filehandle = open(gLogFilePath, O_WRONLY | O_APPEND);
+
+       if (filehandle >= 0) {
+               write(filehandle, buffer, strlen(buffer));
+               close(filehandle);
+       }
+
        mutex_unlock(&gLogLock);
 }
 


Other related posts:

  • » [haiku-commits] r40907 - haiku/trunk/src/add-ons/kernel/drivers/network/wimax/usb_beceemwmx - kallisti5