now creates the monitored directories if they don't exist (0755)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20984 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
218b5bbcc3
commit
3499cb7591
@ -163,12 +163,28 @@ DeviceManager::StartMonitoringDevice(_BDeviceAddOn_ *addon,
|
|||||||
node_ref nref;
|
node_ref nref;
|
||||||
BDirectory directory;
|
BDirectory directory;
|
||||||
BPath path("/dev");
|
BPath path("/dev");
|
||||||
if (((err = path.Append(device)) != B_OK)
|
if ((err = path.Append(device)) != B_OK) {
|
||||||
|| ((err = directory.SetTo(path.Path())) != B_OK)
|
PRINTERR(("DeviceManager::StartMonitoringDevice BPath::Append() error %s: %s\n", path.Path(), strerror(err)));
|
||||||
|| ((err = directory.GetNodeRef(&nref)) != B_OK)) {
|
|
||||||
PRINTERR(("DeviceManager::StartMonitoringDevice error %s: %s\n", path.Path(), strerror(err)));
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((err = directory.SetTo(path.Path())) != B_OK) {
|
||||||
|
if (err != B_ENTRY_NOT_FOUND) {
|
||||||
|
PRINTERR(("DeviceManager::StartMonitoringDevice SetTo error %s: %s\n", path.Path(), strerror(err)));
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
if ((err = create_directory(path.Path(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) != B_OK
|
||||||
|
|| (err = directory.SetTo(path.Path())) != B_OK) {
|
||||||
|
PRINTERR(("DeviceManager::StartMonitoringDevice CreateDirectory error %s: %s\n", path.Path(), strerror(err)));
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((err = directory.GetNodeRef(&nref)) != B_OK) {
|
||||||
|
PRINTERR(("DeviceManager::StartMonitoringDevice GetNodeRef error %s: %s\n", path.Path(), strerror(err)));
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
// test if already monitored
|
// test if already monitored
|
||||||
bool alreadyMonitored = false;
|
bool alreadyMonitored = false;
|
||||||
_BDeviceAddOn_ *tmpaddon = NULL;
|
_BDeviceAddOn_ *tmpaddon = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user