error is in errno, as noticed by axeld!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18587 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -28,6 +28,7 @@ THE SOFTWARE.
|
|||||||
#include <ByteOrder.h>
|
#include <ByteOrder.h>
|
||||||
#include <Drivers.h>
|
#include <Drivers.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -152,7 +153,7 @@ status_t Initialize(int fatbits, const char *device, const char *label, bool nop
|
|||||||
|
|
||||||
int fd = open(device, O_RDWR);
|
int fd = open(device, O_RDWR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
fprintf(stderr,"Error: couldn't open file for device %s %s\n",device, strerror(fd));
|
fprintf(stderr, "Error: couldn't open file for device %s (%s)\n", device, strerror(errno));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user