* BeOS also gives back B_BAD_VALUE on shared libraries when doing BAppFileInfo::SetVersionInfo()

* Furthermore, this call crashes when called with a NULL version info
* Fixed some typos that should have proven problematic under R5/BONE.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19205 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-11-04 17:38:21 +00:00
parent 3f5affa07f
commit 71a0a68ad0

View File

@ -53,7 +53,7 @@ update_icon(BAppFileInfo &appFileInfoRead, BAppFileInfo &appFileInfoWrite,
err = appFileInfoWrite.SetIconForType(type, &icon, iconSize);
else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND) {
err = appFileInfoWrite.SetIconForType(type, NULL, iconSize);
#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) && defined(HAIKU_HOST_PLATFORM_BONE)
#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE)
// gives an error if the attribute didn't exist yet...
err = B_OK;
#endif
@ -217,7 +217,7 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir)
BMimeType type;
if (!err && (updateType || updateAppInfo)) {
err = BMimeType::GuessMimeType(entry, &type);
#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) && defined(HAIKU_HOST_PLATFORM_BONE)
#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE)
if (err)
err = guess_mime_type(entry, &type);
#endif
@ -258,7 +258,7 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir)
else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND || err == B_BAD_VALUE) {
// BeOS returns B_BAD_VALUE on shared libraries
err = appFileInfoWrite.SetSignature(NULL);
#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) && defined(HAIKU_HOST_PLATFORM_BONE)
#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE)
err = B_OK;
#endif
}
@ -285,7 +285,7 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir)
err = appFileInfoWrite.SetSupportedTypes(&supportedTypes);
hasSupportedTypes = true;
} else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND || err == B_BAD_VALUE) {
#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) && defined(HAIKU_HOST_PLATFORM_BONE)
#if defined(HAIKU_HOST_PLATFORM_DANO) || defined(HAIKU_HOST_PLATFORM_BEOS) || defined(HAIKU_HOST_PLATFORM_BONE)
file.RemoveAttr(kSupportedTypesAttr);
err = B_OK;
#else
@ -329,8 +329,14 @@ UpdateMimeInfoThread::DoMimeUpdate(const entry_ref *entry, bool *entryIsDir)
err = appFileInfoRead.GetVersionInfo(&versionInfo, kind);
if (err == B_OK)
err = appFileInfoWrite.SetVersionInfo(&versionInfo, kind);
else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND)
else if (err == B_ENTRY_NOT_FOUND || err == B_NAME_NOT_FOUND || err == B_BAD_VALUE) {
#if !defined(HAIKU_HOST_PLATFORM_DANO) && !defined(HAIKU_HOST_PLATFORM_BEOS) && !defined(HAIKU_HOST_PLATFORM_BONE)
// BeOS crashes when calling SetVersionInfo() with a NULL pointer
err = appFileInfoWrite.SetVersionInfo(NULL, kind);
#else
err = B_OK;
#endif
}
if (err != B_OK)
return err;
}