aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2021-01-25 00:39:58 +0100
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2021-01-25 00:53:37 +0100
commitafeeb72280c4ad7a4d1df9266b9e09aa476a2861 (patch)
treeb1af13280b18cc3ef11c39b761f37a37ddf05ad1
parentd59f6d6c16c2d6c6cc7bb8cee36c14bc4609dffa (diff)
downloadembedlog-afeeb72280c4ad7a4d1df9266b9e09aa476a2861.tar.gz
embedlog-afeeb72280c4ad7a4d1df9266b9e09aa476a2861.tar.bz2
embedlog-afeeb72280c4ad7a4d1df9266b9e09aa476a2861.zip
examples: add missing el_cleanup() to some examples
Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
-rw-r--r--examples/print-thread-safe.c5
-rw-r--r--examples/print-tty.c1
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/print-thread-safe.c b/examples/print-thread-safe.c
index d1d3c55..c21d624 100644
--- a/examples/print-thread-safe.c
+++ b/examples/print-thread-safe.c
@@ -16,13 +16,14 @@ int main(void)
if (el_option(EL_THREAD_SAFE, 1) != 0)
{
el_perror(ELF, "Failed to enable thread safety");
- goto error;
+ el_cleanup();
+ return 1;
}
el_print(ELI, "Yeaaa.... there is no really good way to show");
el_print(ELI, "how pthread works in action, so this just checks");
el_print(ELI, "whether locking works at all");
-error:
el_cleanup();
+ return 0;
}
diff --git a/examples/print-tty.c b/examples/print-tty.c
index ec90d01..889afe3 100644
--- a/examples/print-tty.c
+++ b/examples/print-tty.c
@@ -27,6 +27,7 @@ int main(void)
if (el_option(EL_TTY_DEV, "/dev/ttyUSB1", B9600) != 0)
{
perror("tty set failed");
+ el_cleanup();
return 1;
}