diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2023-01-14 18:50:15 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2023-01-15 08:57:45 -0500 |
commit | 67cb2e3cdc9495ab00ad13c2971222c3da7bb78e (patch) | |
tree | bdce76457c9b4d9e0b818042320408f2820b26f0 /apps/core_keymap.c | |
parent | 9e53d5541fd29dc39d051f9e4f106e0e15df615e (diff) | |
download | rockbox-67cb2e3cdc9495ab00ad13c2971222c3da7bb78e.tar.gz rockbox-67cb2e3cdc9495ab00ad13c2971222c3da7bb78e.zip |
Add core_get_data_pinned(), use it where possible
Change-Id: I1b2f62f27780f99423085d2fffc972ea2701f998
Diffstat (limited to 'apps/core_keymap.c')
-rw-r--r-- | apps/core_keymap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/core_keymap.c b/apps/core_keymap.c index 966f32057a..89e7913c33 100644 --- a/apps/core_keymap.c +++ b/apps/core_keymap.c | |||
@@ -80,11 +80,12 @@ int core_load_key_remap(const char *filename) | |||
80 | int handle = core_alloc(bufsize); | 80 | int handle = core_alloc(bufsize); |
81 | if (handle > 0) | 81 | if (handle > 0) |
82 | { | 82 | { |
83 | core_pin(handle); | 83 | void *data = core_get_data_pinned(handle); |
84 | if (read(fd, core_get_data(handle), bufsize) == (ssize_t)bufsize) | 84 | |
85 | if (read(fd, data, bufsize) == (ssize_t)bufsize) | ||
85 | count = action_set_keymap_handle(handle, count); | 86 | count = action_set_keymap_handle(handle, count); |
86 | 87 | ||
87 | core_unpin(handle); | 88 | core_put_data_pinned(data); |
88 | } | 89 | } |
89 | 90 | ||
90 | close(fd); | 91 | close(fd); |