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
This commit is contained in:
Fredrik Holmqvist 2010-12-28 15:55:57 +00:00
parent b2f1b918ed
commit 14a12acc76

View File

@ -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;
}