package daemon: CommitTransactionHandler: Use NotOwningEntryRef

This commit is contained in:
Ingo Weinhold 2014-04-20 18:44:41 +02:00
parent 9225185b65
commit fb53533e86

View File

@ -230,19 +230,14 @@ CommitTransactionHandler::_ReadPackagesToActivate(
} }
// read the package // read the package
entry_ref entryRef;
entryRef.device = fTransactionDirectoryRef.device;
entryRef.directory = fTransactionDirectoryRef.node;
if (entryRef.set_name(packageName) != B_OK)
throw Exception(B_NO_MEMORY);
package = new(std::nothrow) Package; package = new(std::nothrow) Package;
if (package == NULL || !fPackagesToActivate.AddItem(package)) { if (package == NULL || !fPackagesToActivate.AddItem(package)) {
delete package; delete package;
throw Exception(B_NO_MEMORY); throw Exception(B_NO_MEMORY);
} }
error = package->Init(entryRef); error = package->Init(
NotOwningEntryRef(fTransactionDirectoryRef, packageName));
if (error != B_OK) if (error != B_OK)
throw Exception(error, "failed to read package", packageName); throw Exception(error, "failed to read package", packageName);
@ -403,12 +398,8 @@ CommitTransactionHandler::_AddPackagesToActivate()
} }
// get a BEntry for the package // get a BEntry for the package
entry_ref entryRef; NotOwningEntryRef entryRef(fTransactionDirectoryRef,
entryRef.device = fTransactionDirectoryRef.device; package->FileName());
entryRef.directory = fTransactionDirectoryRef.node;
if (entryRef.set_name(package->FileName()) != B_OK)
throw Exception(B_NO_MEMORY);
BEntry entry; BEntry entry;
error = entry.SetTo(&entryRef); error = entry.SetTo(&entryRef);
if (error != B_OK) { if (error != B_OK) {