mirror of
https://github.com/vivier/EMILE.git
synced 2024-06-12 19:22:46 +00:00
emile-map-set: use O_RDWR to put driver
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
e6a2eb39cf
commit
098deb6716
|
@ -353,7 +353,9 @@ int main(int argc, char** argv)
|
||||||
int flags;
|
int flags;
|
||||||
char *type;
|
char *type;
|
||||||
device_io_t device;
|
device_io_t device;
|
||||||
|
int open_flags;
|
||||||
|
|
||||||
|
open_flags = O_RDONLY;
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
c = getopt_long(argc, argv, "hvg:p:sf:t:", long_options,
|
c = getopt_long(argc, argv, "hvg:p:sf:t:", long_options,
|
||||||
|
@ -378,6 +380,7 @@ int main(int argc, char** argv)
|
||||||
break;
|
break;
|
||||||
case ARG_STARTUP:
|
case ARG_STARTUP:
|
||||||
action |= ACTION_STARTUP;
|
action |= ACTION_STARTUP;
|
||||||
|
open_flags = O_RDWR;
|
||||||
break;
|
break;
|
||||||
case ARG_SCANBUS:
|
case ARG_SCANBUS:
|
||||||
action |= ACTION_SCANBUS;
|
action |= ACTION_SCANBUS;
|
||||||
|
@ -389,6 +392,7 @@ int main(int argc, char** argv)
|
||||||
case ARG_PUT:
|
case ARG_PUT:
|
||||||
action |= ACTION_PUT;
|
action |= ACTION_PUT;
|
||||||
appledriver = optarg;
|
appledriver = optarg;
|
||||||
|
open_flags = O_RDWR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,7 +469,7 @@ int main(int argc, char** argv)
|
||||||
device.read_sector = (stream_read_sector_t)device_read_sector;
|
device.read_sector = (stream_read_sector_t)device_read_sector;
|
||||||
device.close = (stream_close_t)device_close;
|
device.close = (stream_close_t)device_close;
|
||||||
device.get_blocksize = (stream_get_blocksize_t)device_get_blocksize;
|
device.get_blocksize = (stream_get_blocksize_t)device_get_blocksize;
|
||||||
device.data = (void*)device_open(disk_name, O_RDONLY);
|
device.data = (void*)device_open(disk_name, open_flags);
|
||||||
|
|
||||||
map = map_open(&device);
|
map = map_open(&device);
|
||||||
if (map == NULL)
|
if (map == NULL)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user