added error handling
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8743 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
bab3205a73
commit
b00721dd1e
|
@ -220,13 +220,18 @@ Keymap::Dump()
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
status_t
|
||||
Keymap::LoadCurrent()
|
||||
{
|
||||
key_map *keys;
|
||||
key_map *keys = NULL;
|
||||
get_key_map(&keys, &fChars);
|
||||
if (!keys) {
|
||||
fprintf(stderr, "error while getting current keymap!\n");
|
||||
return B_ERROR;
|
||||
}
|
||||
memcpy(&fKeys, keys, sizeof(fKeys));
|
||||
delete keys;
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
class Keymap
|
||||
{
|
||||
public:
|
||||
void LoadCurrent();
|
||||
status_t LoadCurrent();
|
||||
status_t Load(entry_ref &ref);
|
||||
status_t Save(entry_ref &ref);
|
||||
status_t LoadSource(FILE *f);
|
||||
|
|
|
@ -46,7 +46,8 @@ int main(int argc, char **argv)
|
|||
break;
|
||||
if (operation == 'd') {
|
||||
Keymap keymap;
|
||||
keymap.LoadCurrent();
|
||||
if (keymap.LoadCurrent() != B_OK)
|
||||
return 1;
|
||||
keymap.Dump();
|
||||
return 0;
|
||||
} else if (operation == 'r') {
|
||||
|
|
Loading…
Reference in New Issue