Small cleanup, added a comment to some obscure code
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9898 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -22,8 +22,7 @@
|
|||||||
#define SERIAL_DIR "/dev/ports"
|
#define SERIAL_DIR "/dev/ports"
|
||||||
|
|
||||||
// Scans a directory and adds the entries it founds as strings to the
|
// Scans a directory and adds the entries it founds as strings to the
|
||||||
// given list. TODO: It should be moved to another place, since it could be
|
// given list
|
||||||
// used by BJoystick too.
|
|
||||||
static int32
|
static int32
|
||||||
scan_directory(const char *directory, BList *list)
|
scan_directory(const char *directory, BList *list)
|
||||||
{
|
{
|
||||||
@@ -115,9 +114,11 @@ BSerialPort::Open(const char *portName)
|
|||||||
ffd = open(buf, O_RDWR | O_NONBLOCK | O_EXCL);
|
ffd = open(buf, O_RDWR | O_NONBLOCK | O_EXCL);
|
||||||
|
|
||||||
if (ffd >= 0) {
|
if (ffd >= 0) {
|
||||||
//Setup the port
|
// we used open() with O_NONBLOCK flag to let it return immediately,
|
||||||
int ret = fcntl(ffd, F_GETFL);
|
// but we want read/write operations to block if needed,
|
||||||
fcntl(ffd, F_SETFL, ret & 0x7F);
|
// so we clear that bit here.
|
||||||
|
int flags = fcntl(ffd, F_GETFL);
|
||||||
|
fcntl(ffd, F_SETFL, flags & ~O_NONBLOCK);
|
||||||
|
|
||||||
DriverControl();
|
DriverControl();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user