open() error is reported in errno
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18676 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
FILE *KeyboardInputDevice::sLogFile = NULL;
|
FILE *KeyboardInputDevice::sLogFile = NULL;
|
||||||
@@ -425,7 +426,7 @@ KeyboardInputDevice::Start(const char *name, void *cookie)
|
|||||||
keyboard_device *device = (keyboard_device *)cookie;
|
keyboard_device *device = (keyboard_device *)cookie;
|
||||||
|
|
||||||
if ((device->fd = open(device->path, O_RDWR)) < B_OK) {
|
if ((device->fd = open(device->path, O_RDWR)) < B_OK) {
|
||||||
fprintf(stderr, "error when opening %s: %s\n", device->path, strerror(device->fd));
|
fprintf(stderr, "error when opening %s: %s\n", device->path, strerror(errno));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user