From 71a0a68ad01364a3bebb034ec573bae4d837effe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 4 Nov 2006 17:38:21 +0000 Subject: [PATCH] * 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 --- .../libbe/storage/mime/UpdateMimeInfoThread.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/build/libbe/storage/mime/UpdateMimeInfoThread.cpp b/src/build/libbe/storage/mime/UpdateMimeInfoThread.cpp index 31e512d7e3..03a2c0a199 100644 --- a/src/build/libbe/storage/mime/UpdateMimeInfoThread.cpp +++ b/src/build/libbe/storage/mime/UpdateMimeInfoThread.cpp @@ -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; }