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

Author: kallisti5
Date: 2011-03-08 16:27:42 +0100 (Tue, 08 Mar 2011)
New Revision: 40870
Changeset: http://dev.haiku-os.org/changeset/40870

Modified:
   
haiku/trunk/src/add-ons/kernel/drivers/network/wimax/usb_beceemwmx/Settings.cpp
Log:
fix possible passing of signed int to function that only receives unsigned 
ints, CID 3491

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-08 15:27:33 UTC (rev 40869)
+++ 
haiku/trunk/src/add-ons/kernel/drivers/network/wimax/usb_beceemwmx/Settings.cpp 
    2011-03-08 15:27:42 UTC (rev 40870)
@@ -34,7 +34,10 @@
                return;
 
        int flags = O_WRONLY | O_CREAT | ((gTruncateLogFile) ? O_TRUNC : 0);
-       close(open(gLogFilePath, flags, 0666));
+       int filehandle = open(gLogFilePath, flags, 0666);
+       if (filehandle >= 0)
+               close(filehandle);
+       }
 
        mutex_init(&gLogLock, DRIVER_NAME"-logging");
 }


Other related posts: