aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* .vimrc: add basic formatting config for vim users0.5Michał Łyszczek2020-05-281-0/+12
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* fix git links after domain changeMichał Łyszczek2019-08-222-3/+3
| | | | | no_ci Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* move embedlog from kurwinet.pl to bofc.plMichał Łyszczek2019-08-2211-60/+60
| | | | | no_ci Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* man/el_init.3: add missing .PP and fix typoMichał Łyszczek2019-08-201-1/+2
| | | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl> no_ci
* src/el-decode-number.c: fix potential loose of precision on 64bit systemsMichał Łyszczek2019-07-291-1/+5
| | | | | | | | | | | | | | | | | *out |= (n[i] & 0x7f) << (i * 7); (n[i] & 0x7f) - will be an int value (32bit in most cases) and if (i * 7) is larger than 32, we will shift outside of 32bit and 0 will be written into *out which is not what we want. To prevent this, left operand of << should be first casted to 64bit and then shift should be performed. Marking no_ci since this code is not used in embedlog, and is provided as an example for decoding numbers in binary logs. no_ci Reported-by: pvs-studio Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* update version to v0.5.0v0.5.0Michał Łyszczek2019-06-108-8/+8
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* code in master should always have version v9999Michał Łyszczek2019-06-108-8/+8
| | | | | | | | Version should be changed in branch, and v9999 should indicate master - unstable software. Good for daily builds. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl> no_buildbot
* include/embedlog.h.in: add back EL_FILE_SYNC_* for compatibilityMichał Łyszczek2019-06-101-0/+2
| | | | | | | | | Although EL_FILE_SYNC_* has been renamed to EL_FSYNC_*, it is wise to leave old enum for backward compatibility. It doesn't make code any bigger. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl> no_buildbot
* src/el-file.c: don't flush when no data has been writtenMichał Łyszczek2019-06-092-0/+34
| | | | | | | | When no data has been written to file, there is not need to perform fsync() syscall, which in this case will only eat cycles for context switch without doing anything. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* src/el-private.h: add missing ']' to EL_PRE_FUNCINFO_LENMichał Łyszczek2019-06-081-2/+2
| | | | | | | | | When funcinfo is being printed, 4 characters are printed beside function name: [()]. But EL_PRE_FUNCINFO_LEN was configured to add only 3 characters, which may lead to buffer overflow in corner cases. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* src/el-private.h: add missing EL_PRE_FUNCINFO_LEN to EL_PRE_LEN calcMichał Łyszczek2019-06-082-4/+9
| | | | | | | | EL_PRE_FUNCINFO_LEN was missing when calculating EL_PRE_LEN, which is used to calculate EL_BUF_MAX. Without that, buffer was too small to hold all print information, which could result in buffer overflow. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* src/el-print.c: fix possible buffer overflow in el_print()Michał Łyszczek2019-06-083-5/+29
| | | | | | | | | In case when message, finfo and colors are enabled and are full (their text is as long as defined max values) it was possible to overflow buffer. Very rare situation but surely it will happend, to someone one day. Not anymore, it won't. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-file.c: remove testing uninitialized objectMichał Łyszczek2019-05-211-11/+0
| | | | | | | Cmon... it's pretty pointless and random at best. It's quite the miracle it never failed before. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* */Makefile.am: usr $top_builddir for include path for embedlog.hMichał Łyszczek2019-05-213-3/+3
| | | | | | | | embedlog.h is now generated, so include paths must be changed so that path to generated file is passed. This is needed to make out of tree compilation work. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-pmemory.c: add tests for el_o* variantsMichał Łyszczek2019-05-201-0/+69
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* src/el-pmemory.c: call el_pmem() directly and not via proxyMichał Łyszczek2019-05-201-2/+2
| | | | | | | | | This is readability patch, el_pmemory_table() was calling el_opmemory_table() which was calling el_pmem(). Such proxy is not needed and lower readability. Now el_pmemory_table() calls el_pmem() directly with no proxy. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* test-compilation.sh: use {#} as directory name for resultsMichał Łyszczek2019-05-201-5/+10
| | | | | | | | | | Previously parallel was creating directory based on options, but we have so many options now, that length of directory name is larger than 260 chars, and FS returns error. Now directory will be named after seq number. Info about seq number and what options is associated with it, will bo stored in compilation-test-results. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* test-compilation.sh: remove stdout when test is successfullMichał Łyszczek2019-05-191-1/+9
| | | | | | | | stdout can take a lot of space, and if we multiply it by number of compilation we do it will take TONS of memory just to hold unneded data. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-pbinary.c: modify mix test to print to bufferMichał Łyszczek2019-05-191-12/+58
| | | | | | | | This is a long test, and printing data to file took a lot of time. Printing to buffer (so ram) shortens the test by order of magnitude. It also tests custom print for binary data as a bonus. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* add support to use custom put with binary dataMichał Łyszczek2019-05-198-19/+51
| | | | | | | | Previously binary data could be printed only to file, not it's possible to print it to custom function as well. For that el_custom_put has been extended with "size_t slen" to provide information about buffer size. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* m4/ax_pthread.m4: add macro for pthread flag generationMichał Łyszczek2019-05-191-0/+485
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* test-compilation.sh: clone from local dir instead of remote serverMichał Łyszczek2019-05-191-2/+3
| | | | | | | | | - it allows for compilation tests without pushing to remote - clones are faster - clone doesn't crash when tere are a lot of parallel clones (server rejects connections) Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* examples/el-lock.c: add missing el-lock.c file to example dirMichał Łyszczek2019-05-191-0/+1
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* test-compilation.sh: add generation of compilation test resultsMichał Łyszczek2019-05-191-2/+13
| | | | | | | | compilation-test-results will be generated in the directory where test-compilation.sh is, with information which flags did succed and which did not. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* test-compilation-options: add --enable-pthread to compilation test flsgsMichał Łyszczek2019-05-191-0/+1
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* src/Makefile.am: force clang --analyze to use local embedlog.hMichał Łyszczek2019-05-191-1/+1
| | | | | | | | Without that -I../include, clang were loading system-wide embedlog.h which could result in errror in case when system embedlog.h is different than local one. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/main.c: fix 'unused variable' warningMichał Łyszczek2019-05-191-0/+3
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* add thread safety to libraryMichał Łyszczek2019-05-1921-86/+1226
| | | | | | | embedlog now can be safely used in multi-thread environment, that implements pthread. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* man/el_option.3: fix formating errorMichał Łyszczek2019-05-191-1/+2
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-{pbinary,print}.c: add missing options to the mixMichał Łyszczek2019-05-192-44/+47
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-print.c: run each step in mix test as separate testMichał Łyszczek2019-05-191-11/+22
| | | | | | | | print_mix_of_everything() takes a long time, and it looks like it hung. This patch changes all mt_fok() checks to mt_run() so, message for each check is printed. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-pbinary.c: run each step in mix test as separate testMichał Łyszczek2019-05-181-16/+21
| | | | | | | | pbinary_mix_of_everything() takes a long time, and it looks like it hung. This patch changes all mt_fok() checks to mt_run() so, message for each check is printed. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-pbinary.c: add timer source to mix testMichał Łyszczek2019-05-181-0/+3
| | | | | | | | Previously default value was set (time()) which resulted in fraction never being tested, since time() returns only seconds, without fractions. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-pbinary.c: add missing checks for nsec and msecMichał Łyszczek2019-05-181-23/+47
| | | | | | | print_check() contained checks only for usec which resulted in false check errors. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-pbinary.c: fix operator precedenceMichał Łyszczek2019-05-181-2/+2
| | | | | | | if (flags & 0x04 != 0x04) is invalid, as 0x04 != 0x04 will be evaluated first. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-pbinary.c: add print messages upon print_check() errorMichał Łyszczek2019-05-181-2/+19
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/mtest.h: udpate mtest to v1.1.4Michał Łyszczek2019-05-181-16/+116
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* src/snprintf.c: fix compilation warning with -ansiMichał Łyszczek2019-05-181-0/+2
| | | | | | | | | | | When -ansi flag is enabled, configure won't find snprintf() function and will set NEED_SNPRINTF_ONLY. But with it "credits" variable will not be present in compilation unit as it requries PREFER_PORTABLE_SNPRINTF - which we don't want to set. So "str_arg = credits;" should be used only when PREFER_PORTABLE_SNPRINTF is defined. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* configure.ac: remove unneeded AC_CHECK_FUNCSMichał Łyszczek2019-05-181-26/+3
| | | | | | | | | | | This patch removes check for functions that we cannot live without anyway. Like - it's pointles to check for strlen(), if that function is not available, program will not compile no matter what. But checks like access(), if these functions are not available, we can use different one (usually slower), and we can still work. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* src/valid.h: add some more VALID macrosMichał Łyszczek2019-05-171-7/+45
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* tst/test-el-print.c: print error messages in print_check()Michał Łyszczek2019-05-171-3/+51
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* src: add "public api" comment to public functions.Michał Łyszczek2019-05-167-25/+25
| | | | | | | | All functions that are part of library public API, have now comment stating that fact. It's easier now to know if function can be called by external user or not. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* man: update "see also" section.Michał Łyszczek2019-05-156-82/+84
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* man/el_overview.7: change .EX, .EE to .nf, .fiMichał Łyszczek2019-05-151-12/+12
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* change formating of comments for better readabilityMichał Łyszczek2019-05-1521-1167/+1115
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* nclude/embedlog.h.in: fix typoMichał Łyszczek2019-05-151-1/+1
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* struct el: rename current_log to fcurrent_logMichał Łyszczek2019-05-152-29/+29
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* struct el: rename written_after_sync to fwritten_after_syncMichał Łyszczek2019-05-152-4/+4
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* struct el: rename file_sync_every to fsync_every for consistencyMichał Łyszczek2019-05-154-6/+6
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
* struct el: rename file_sync_level to fsync_level for consistencyMichał Łyszczek2019-05-154-10/+10
| | | | Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>