From 3c25084c0eaf85d730bcc052bfe380e456bec8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 30 Jul 2007 18:43:32 +0000 Subject: [PATCH] only add libglut.so on x86 added keymap symlinks Finnish, Brazilian, Croatian Keymap preferences app wasn't able to load symlinked keymaps git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21756 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/HaikuImage | 5 +++++ src/preferences/keymap/Keymap.cpp | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index f997b78f3f..0930e77676 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -174,7 +174,9 @@ AddSymlinkToHaikuImage beos system lib : libnetwork.so : libnet.so ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libnetapi.so ; AddSymlinkToHaikuImage beos system lib : libnetwork.so : libbnetapi.so ; # libGL.so have GLUT built-in +if $(TARGET_ARCH) = x86 { AddSymlinkToHaikuImage beos system lib : $(X86_ONLY)libGL.so : libglut.so ; +} # servers AddFilesToHaikuImage beos system servers : $(BEOS_SYSTEM_SERVERS) ; @@ -306,6 +308,9 @@ local keymapFiles = [ GLOB [ FDirName $(HAIKU_TOP) src data etc keymaps ] : *.keymap ] ; keymapFiles = $(keymapFiles:BG=keymap) ; AddFilesToHaikuImage beos etc Keymap : $(keymapFiles) ; +AddSymlinkToHaikuImage beos etc Keymap : Swedish : Finnish ; +AddSymlinkToHaikuImage beos etc Keymap : Slovene : Croatian ; +AddSymlinkToHaikuImage beos etc Keymap : US-International : Brazilian ; local timezones = [ FTimeZoneBinaries $(HAIKU_TIME_ZONE_SOURCES) : : true ] ; for timezone in $(timezones) { diff --git a/src/preferences/keymap/Keymap.cpp b/src/preferences/keymap/Keymap.cpp index 1c457082a3..11456eac9c 100644 --- a/src/preferences/keymap/Keymap.cpp +++ b/src/preferences/keymap/Keymap.cpp @@ -86,21 +86,28 @@ status_t Keymap::Load(entry_ref &ref) { status_t err; - - BFile file(&ref, B_READ_ONLY); - if ((err = file.InitCheck()) != B_OK) { - printf("error %s\n", strerror(err)); + BEntry entry(&ref, true); + if ((err = entry.InitCheck()) != B_OK) { + fprintf(stderr, "error loading keymap: %s\n", strerror(err)); return err; } - if (file.Read(&fKeys, sizeof(fKeys)) < (ssize_t)sizeof(fKeys)) { + BFile file(&entry, B_READ_ONLY); + if ((err = file.InitCheck()) != B_OK) { + fprintf(stderr, "error loading keymap: %s\n", strerror(err)); + return err; + } + + if ((err = file.Read(&fKeys, sizeof(fKeys))) < (ssize_t)sizeof(fKeys)) { + fprintf(stderr, "error reading keymap keys: %s\n", strerror(err)); return B_BAD_VALUE; } for (uint32 i=0; i