aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-05-06 12:54:47 +0200
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-05-06 12:54:51 +0200
commit64efa3fd8c29fb8a572740ba010f5b51d013c8a0 (patch)
tree681303a74259a52b52ca172f42822e2bd646d62f
parent139b36f884098cced07bd045e429b734dff0bef4 (diff)
downloadembedlog-64efa3fd8c29fb8a572740ba010f5b51d013c8a0.tar.gz
embedlog-64efa3fd8c29fb8a572740ba010f5b51d013c8a0.tar.bz2
embedlog-64efa3fd8c29fb8a572740ba010f5b51d013c8a0.zip
last time minor fixes
no_buildbot
-rw-r--r--man/el_cleanup.32
-rw-r--r--man/el_init.327
-rw-r--r--man/el_option.312
-rw-r--r--man/el_overview.72
-rw-r--r--man/el_print.32
-rw-r--r--src/el-options.c12
6 files changed, 39 insertions, 18 deletions
diff --git a/man/el_cleanup.3 b/man/el_cleanup.3
index a63fd0d..1a03a18 100644
--- a/man/el_cleanup.3
+++ b/man/el_cleanup.3
@@ -1,4 +1,4 @@
-.TH "el_cleanup" "3" " 3 May 2018 (v0.3.0)" "bofc.pl"
+.TH "el_cleanup" "3" " 6 May 2018 (v0.3.0)" "bofc.pl"
.SH NAME
.PP
.B el_cleanup
diff --git a/man/el_init.3 b/man/el_init.3
index 7c81289..39fcee3 100644
--- a/man/el_init.3
+++ b/man/el_init.3
@@ -1,4 +1,4 @@
-.TH "el_init" "3" " 3 May 2018 (v0.3.0)" "bofc.pl"
+.TH "el_init" "3" " 6 May 2018 (v0.3.0)" "bofc.pl"
.SH NAME
.PP
.B el_init
@@ -17,17 +17,32 @@ There are two types of functions in
Functions that use global static structure inside library, these functions don't
accept
.I options
-argument, and are not thread-safe.
+argument.
.PP
Another type are functions that accept
.I options
argument. These functions are prefixed with
.BR el_o .
-Options functions are thread-safe provided that threads are working on different
-.I options
-objects and
+.PP
+All functions (options or not) are "line" thread-safe (provided that
.B \-\-enable\-reentrant
-is turned on.
+is turned on).
+That means library buffers whole line before it calls
+.B puts
+function, so lines in output will not overlap.
+.PP
+NOTE: this may not be entirely true for every operating system there is! Yes,
+.B embedlog
+will always buffer and print whole lines, but OS may, for example interrupt
+.B puts
+call from thread1, and call
+.B puts
+from thread2.
+In such case output will be mangled with 2 different lines.
+While this situation is very rare, it's only fair to mention it.
+If in doubt, check
+.B stdio
+implementation in your operating system.
.PP
.BR el_init (3)
initializes static global option structure. This option structure is used by all
diff --git a/man/el_option.3 b/man/el_option.3
index 012e435..c67b987 100644
--- a/man/el_option.3
+++ b/man/el_option.3
@@ -1,4 +1,4 @@
-.TH "el_option" "3" " 3 May 2018 (v0.3.0)" "bofc.pl"
+.TH "el_option" "3" " 6 May 2018 (v0.3.0)" "bofc.pl"
.SH NAME
.PP
.B el_option
@@ -423,8 +423,14 @@ for any of the errors specified for the routing
. BR fopen ()
. RE
.PP
-If function fails, file is not opened and any calls that logs to file will
+If function fails with
+.B EINVAL
+or
+.BR ENAMETOOLONG ,
+file is not opened and any calls that logs to file will
result in failure.
+Any other error is in reality just a warning, meaning file could not have been
+opened now, but embedlog will try to reopen in each time it logs to file.
.RE
.PP
.BI "EL_FROTATE_NUMBER (" long " number)"
@@ -594,7 +600,7 @@ is invalid.
.B ENOSYS
Passed
.I option
-is not supported on this system (support was not compiled)/
+is not supported on this system (support was not compiled)
Also check for error description of specific option that failed for more
informations
.SH SEE ALSO
diff --git a/man/el_overview.7 b/man/el_overview.7
index fec6808..d26e5b3 100644
--- a/man/el_overview.7
+++ b/man/el_overview.7
@@ -1,4 +1,4 @@
-.TH "el_overview" "7" " 3 May 2018 (v0.3.0)" "bofc.pl"
+.TH "el_overview" "7" " 6 May 2018 (v0.3.0)" "bofc.pl"
.SH NAME
.PP
.B el_overview
diff --git a/man/el_print.3 b/man/el_print.3
index 93b0090..8a76e05 100644
--- a/man/el_print.3
+++ b/man/el_print.3
@@ -1,4 +1,4 @@
-.TH "el_print" "3" " 3 May 2018 (v0.3.0)" "bofc.pl"
+.TH "el_print" "3" " 6 May 2018 (v0.3.0)" "bofc.pl"
.SH NAME
.PP
.BR el_print ,
diff --git a/src/el-options.c b/src/el-options.c
index 9bc9758..1d83646 100644
--- a/src/el-options.c
+++ b/src/el-options.c
@@ -233,17 +233,17 @@ static int el_vooption
VALID(EINVAL, 0 <= value_int && value_int < EL_TS_TM_ERROR);
-# if ENABLE_REALTIME == 0
+# if ENABLE_REALTIME == 0
VALID(ENODEV, value_int != EL_TS_TM_REALTIME);
-# endif
+# endif
-# if ENABLE_MONOTONIC == 0
+# if ENABLE_MONOTONIC == 0
VALID(ENODEV, value_int != EL_TS_TM_MONOTONIC);
-# endif
+# endif
-# if ENABLE_CLOCK == 0
+# if ENABLE_CLOCK == 0
VALID(ENODEV, value_int != EL_TS_TM_CLOCK);
-# endif
+# endif
options->timestamp_timer = value_int;
return 0;