diff options
author | Amaury Pouly <pamaury@rockbox.org> | 2009-12-24 17:07:20 +0000 |
---|---|---|
committer | Amaury Pouly <pamaury@rockbox.org> | 2009-12-24 17:07:20 +0000 |
commit | 081da63d097dd5a1de360abd6dcf5c0eb01ecdfc (patch) | |
tree | 51dd9f3cb98d5e353ab136ebba3af4faec55f968 | |
parent | eeb1f3e25e5071cb338dd96cb9d30b6f9b6d45d2 (diff) | |
download | rockbox-081da63d097dd5a1de360abd6dcf5c0eb01ecdfc.tar.gz rockbox-081da63d097dd5a1de360abd6dcf5c0eb01ecdfc.zip |
Add support for errno in plugins.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24109 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugin.c | 2 | ||||
-rw-r--r-- | apps/plugin.h | 1 | ||||
-rw-r--r-- | firmware/include/errno.h | 4 |
3 files changed, 7 insertions, 0 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 3836d76d28..bd88da6647 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "version.h" | 40 | #include "version.h" |
41 | #include "storage.h" | 41 | #include "storage.h" |
42 | #include "pcmbuf.h" | 42 | #include "pcmbuf.h" |
43 | #include "errno.h" | ||
43 | 44 | ||
44 | #if CONFIG_CHARGING | 45 | #if CONFIG_CHARGING |
45 | #include "power.h" | 46 | #include "power.h" |
@@ -680,6 +681,7 @@ static const struct plugin_api rockbox_api = { | |||
680 | viewportmanager_theme_enable, | 681 | viewportmanager_theme_enable, |
681 | viewportmanager_theme_undo, | 682 | viewportmanager_theme_undo, |
682 | #endif | 683 | #endif |
684 | &errno | ||
683 | }; | 685 | }; |
684 | 686 | ||
685 | int plugin_load(const char* plugin, const void* parameter) | 687 | int plugin_load(const char* plugin, const void* parameter) |
diff --git a/apps/plugin.h b/apps/plugin.h index 632533cb47..0a9b8a9a50 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -860,6 +860,7 @@ struct plugin_api { | |||
860 | struct viewport *viewport); | 860 | struct viewport *viewport); |
861 | void (*viewportmanager_theme_undo)(enum screen_type screen, bool force_redraw); | 861 | void (*viewportmanager_theme_undo)(enum screen_type screen, bool force_redraw); |
862 | #endif | 862 | #endif |
863 | int* __errno; | ||
863 | }; | 864 | }; |
864 | 865 | ||
865 | /* plugin header */ | 866 | /* plugin header */ |
diff --git a/firmware/include/errno.h b/firmware/include/errno.h index 846cd0e339..3a923238fc 100644 --- a/firmware/include/errno.h +++ b/firmware/include/errno.h | |||
@@ -10,7 +10,11 @@ | |||
10 | 10 | ||
11 | #ifndef _SYS_ERRNO_H_ | 11 | #ifndef _SYS_ERRNO_H_ |
12 | 12 | ||
13 | #ifdef PLUGIN | ||
14 | #define errno (*rb->__errno) | ||
15 | #else | ||
13 | extern int errno; | 16 | extern int errno; |
17 | #endif | ||
14 | 18 | ||
15 | #define EPERM 1 /* Not super-user */ | 19 | #define EPERM 1 /* Not super-user */ |
16 | #define ENOENT 2 /* No such file or directory */ | 20 | #define ENOENT 2 /* No such file or directory */ |