64 lines
2.3 KiB
Diff
64 lines
2.3 KiB
Diff
From: Gabriel Valcazar <gabriel.valcazar@digi.com>
|
|
Date: Wed, 23 Jun 2021 10:05:24 +0200
|
|
Subject: [PATCH 1/2] cog: remove the --platform parameter and hardcode the FDO
|
|
platform
|
|
|
|
We don't want users to accidentally generate errors by using different
|
|
platforms, so always use the FDO one by default.
|
|
|
|
Signed-off-by: Gabriel Valcazar <gabriel.valcazar@digi.com>
|
|
---
|
|
cog.c | 25 ++++---------------------
|
|
1 file changed, 4 insertions(+), 21 deletions(-)
|
|
|
|
diff --git a/cog.c b/cog.c
|
|
index 2fdc7b2..bb64506 100644
|
|
--- a/cog.c
|
|
+++ b/cog.c
|
|
@@ -40,10 +40,7 @@ static struct {
|
|
GStrv dir_handlers;
|
|
GStrv arguments;
|
|
char *background_color;
|
|
- union {
|
|
- char *platform_name;
|
|
- CogPlatform *platform;
|
|
- };
|
|
+ CogPlatform *platform;
|
|
union {
|
|
char *action_name;
|
|
enum webprocess_fail_action action_id;
|
|
@@ -92,9 +89,6 @@ static GOptionEntry s_cli_options[] =
|
|
{ "bg-color", 'b', 0, G_OPTION_ARG_STRING, &s_options.background_color,
|
|
"Background color, as a CSS name or in #RRGGBBAA hex syntax (default: white)",
|
|
"BG_COLOR" },
|
|
- { "platform", 'P', 0, G_OPTION_ARG_STRING, &s_options.platform_name,
|
|
- "Platform plug-in to use.",
|
|
- "NAME" },
|
|
{ "web-extensions-dir", '\0', 0, G_OPTION_ARG_STRING, &s_options.web_extensions_dir,
|
|
"Load Web Extensions from given directory.",
|
|
"PATH"},
|
|
@@ -299,21 +293,10 @@ platform_setup (CogShell *shell)
|
|
* a given platform.
|
|
*/
|
|
|
|
- g_debug ("%s: Platform name: %s", __func__, s_options.platform_name);
|
|
-
|
|
- if (!s_options.platform_name)
|
|
- return FALSE;
|
|
-
|
|
- g_autofree char *platform_soname =
|
|
- g_strdup_printf ("libcogplatform-%s.so", s_options.platform_name);
|
|
- g_clear_pointer (&s_options.platform_name, g_free);
|
|
-
|
|
- g_debug ("%s: Platform plugin: %s", __func__, platform_soname);
|
|
-
|
|
g_autoptr(CogPlatform) platform = cog_platform_new ();
|
|
- if (!cog_platform_try_load (platform, platform_soname)) {
|
|
- g_warning ("Could not load: %s (possible cause: %s).\n",
|
|
- platform_soname, strerror (errno));
|
|
+ if (!cog_platform_try_load (platform, "libcogplatform-fdo.so")) {
|
|
+ g_warning ("Could not load: libcogplatform-fdo.so (possible cause: %s).\n",
|
|
+ strerror (errno));
|
|
return FALSE;
|
|
}
|