Replace usages of B_FILE_NOT_FOUND in non-BeOS-API code.

B_FILE_NOT_FOUND was deprecated in BeOS R5 in favor of B_ENTRY_NOT_FOUND,
but it remained in Haiku and was never removed even conditionally, so
we have accumulated a number of usages of it.

This commit changes all the usages of it in new code, applications,
or anything else that BeOS applications will otherwise never see,
and so should be relatively safe.
This commit is contained in:
Augustin Cavalier
2021-10-19 11:33:47 -04:00
parent 36df12a51a
commit 1a3be0addd
9 changed files with 16 additions and 17 deletions
@@ -341,8 +341,8 @@ NFS4Server::CallbackRecall(RequestInterpreter* request, ReplyBuilder* reply)
locker.Unlock();
if (delegation == NULL) {
reply->Recall(B_FILE_NOT_FOUND);
return B_FILE_NOT_FOUND;
reply->Recall(B_ENTRY_NOT_FOUND);
return B_ENTRY_NOT_FOUND;
}
DelegationRecallArgs* args = new(std::nothrow) DelegationRecallArgs;
@@ -383,8 +383,8 @@ NFS4Server::CallbackGetAttr(RequestInterpreter* request, ReplyBuilder* reply)
locker.Unlock();
if (delegation == NULL) {
reply->GetAttr(B_FILE_NOT_FOUND, 0, 0, 0);
return B_FILE_NOT_FOUND;
reply->GetAttr(B_ENTRY_NOT_FOUND, 0, 0, 0);
return B_ENTRY_NOT_FOUND;
}
struct stat st;
@@ -114,7 +114,7 @@ ReplyBuilder::_HaikuErrorToNFS4(status_t error)
{
switch (error) {
case B_OK: return NFS4_OK;
case B_FILE_NOT_FOUND: return NFS4ERR_BADHANDLE;
case B_ENTRY_NOT_FOUND: return NFS4ERR_BADHANDLE;
case B_NOT_SUPPORTED: return NFS4ERR_OP_ILLEGAL;
default: return NFS4ERR_RESOURCE;
}
@@ -946,7 +946,7 @@ ReplyInterpreter::_NFS4ErrorToHaiku(uint32 x)
case NFS4ERR_STALE:
case NFS4ERR_FHEXPIRED:
return B_FILE_NOT_FOUND;
return B_ENTRY_NOT_FOUND;
// ...
default: return B_ERROR;
}
@@ -418,7 +418,7 @@ ZipperThread::_SelectInTracker(int32 tryNumber)
BEntry entry(&fOutputEntryRef);
if (!entry.Exists())
return B_FILE_NOT_FOUND;
return B_ENTRY_NOT_FOUND;
entry.GetParent(&entry);
entry.GetRef(&parentRef);
@@ -108,7 +108,7 @@ AbstractServerProcess::IfModifiedSinceHeaderValue(BString& headerValue,
if (ENOENT != errno)
return B_ERROR;
return B_FILE_NOT_FOUND;
return B_ENTRY_NOT_FOUND;
}
if (s.st_size == 0)
@@ -193,7 +193,7 @@ AbstractServerProcess::ParseJsonFromFileWithListener(
if (file == NULL) {
HDERROR("[%s] unable to find the meta data file at [%s]", Name(),
path.Path());
return B_FILE_NOT_FOUND;
return B_ENTRY_NOT_FOUND;
}
BFileIO rawInput(file, true); // takes ownership
+5 -5
View File
@@ -594,7 +594,7 @@ Hey(BMessenger* target, char* argv[], int32* argx, int32 argc, BMessage* reply)
(*argx)++;
result = add_data(&the_message, argv, argx);
if (result != B_OK) {
if (result == B_FILE_NOT_FOUND) {
if (result == B_ENTRY_NOT_FOUND) {
if (!silent)
fprintf(stderr, "File not found!\n");
} else if (!silent)
@@ -635,7 +635,7 @@ add_with(BMessage *to_message, char *argv[], int32 *argx, int32 argc)
do {
result = add_data(to_message, argv, argx);
if (result != B_OK) {
if (result == B_FILE_NOT_FOUND) {
if (result == B_ENTRY_NOT_FOUND) {
if (!silent)
fprintf(stderr, "File not found!\n");
} else {
@@ -946,13 +946,13 @@ add_data(BMessage *to_message, char *argv[], int32 *argx)
valuestring[strlen(valuestring) - 1] = 0;
if (get_ref_for_path(valuestring + 5, &file_ref) != B_OK)
return B_FILE_NOT_FOUND;
return B_ENTRY_NOT_FOUND;
// check if the ref is valid
BEntry entry;
if (entry.SetTo(&file_ref) != B_OK)
return B_FILE_NOT_FOUND;
//if(!entry.Exists()) return B_FILE_NOT_FOUND;
return B_ENTRY_NOT_FOUND;
//if(!entry.Exists()) return B_ENTRY_NOT_FOUND;
// add both ways, refsreceived needs it as "refs" while scripting needs "data"
to_message->AddRef("refs", &file_ref);
@@ -146,7 +146,7 @@ BRepositoryBuilder::AddPackage(const char* path, BSolverPackage** _package)
BEntry entry(path, true);
if (!entry.Exists()) {
DIE_DETAILS(errorListener.Errors(), B_FILE_NOT_FOUND,
DIE_DETAILS(errorListener.Errors(), B_ENTRY_NOT_FOUND,
"the package data file does not exist at \"%s\"", path);
}
+1 -1
View File
@@ -214,7 +214,7 @@ AutoConfigView::_GetSMTPAddOnRef(entry_ref *ref)
return B_OK;
}
return B_FILE_NOT_FOUND;
return B_ENTRY_NOT_FOUND;
}
@@ -71,7 +71,6 @@ toserror(int32 err)
case -32: /* EINVFN - Invalid function */
return B_BAD_VALUE;
case -33: /* EFILNF - File not found */
return B_FILE_NOT_FOUND;
case -34: /* EPTHNF - Path not found */
return B_ENTRY_NOT_FOUND;
case -35: /* ENHNDL - No more handles */