From 14a12acc765c2cf8159b9d41092ddbcb82072f82 Mon Sep 17 00:00:00 2001 From: Fredrik Holmqvist Date: Tue, 28 Dec 2010 15:55:57 +0000 Subject: [PATCH] Only close device if it's a valid fd. CID 3466. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39982 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp b/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp index 3d59a66860..34551742f6 100644 --- a/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp +++ b/src/add-ons/input_server/devices/mouse/MouseInputDevice.cpp @@ -228,7 +228,9 @@ MouseDevice::Start() if (status < B_OK) { LOG_ERR("%s: can't spawn/resume watching thread: %s\n", fDeviceRef.name, strerror(status)); - close(fDevice); + if (fDevice >= B_OK) + close(fDevice); + return status; }