open() fails with -1
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20820 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "driver_io.h"
|
#include "driver_io.h"
|
||||||
#include <MediaDefs.h>
|
#include <MediaDefs.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
float SAMPLE_RATES[] = {
|
float SAMPLE_RATES[] = {
|
||||||
@@ -198,9 +199,10 @@ status_t MultiAudioDevice::InitDriver()
|
|||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
//open the device driver for output
|
//open the device driver for output
|
||||||
fd = open( fDevice_path, O_WRONLY );
|
fd = open(fDevice_path, O_WRONLY);
|
||||||
|
|
||||||
if ( fd == 0 ) {
|
if (fd == -1) {
|
||||||
|
fprintf(stderr, "Failed to open %s: %s\n", fDevice_path, strerror(errno));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user