summaryrefslogtreecommitdiff
path: root/iputils_common.h
Commit message (Collapse)AuthorAgeFilesLines
* common: move various fallback definitions into iputils_common.hPetr Vorel2019-06-101-0/+25
| | | | Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
* common: use single ARRAY_SIZE definition across filesSami Kerola2019-03-231-0/+8
| | | | | | | | | | The ARRAY_SIZE is Rusty Russell’s version, that looks a bit more complicated than the original, but there is a reason to that. This macro will ensure macro is used properly, and fail compilation if it is not. See reference link for further explanation. Reference: http://zubplot.blogspot.com/2015/01/gcc-is-wonderful-better-arraysize-macro.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libcommon: add string to a number conversion functionSami Kerola2019-02-031-0/+2
| | | | | | | Based on standard libc strtol(), but has convenience wrapping to catch errors so that one can convert numbers with just a single function call. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ninfod: check writing a pid file was successfulSami Kerola2019-01-011-0/+1
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libcommon: check standard streams status at exitSami Kerola2019-01-011-0/+2
| | | | | | | | | | | | | | Earlier commands happily successed when writing to standard out or error did not work. Following demonstrates old and new behavior of all commands in this project. $ ping -c 1 127.0.0.1 > /dev/full ; echo $? 0 $ ping -c 1 127.0.0.1 > /dev/full ; echo $? ./builddir/ping: write error: No space left on device 1 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* common: move error() portability go-around to common librarySami Kerola2018-12-221-0/+6
| | | | | | | This allows use of error() in other programs. The static common library can also be used for other utility functions in future. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* localization: move nls headers to iputils_common.hSami Kerola2018-12-181-0/+19
Aboid boilerplating. Signed-off-by: Sami Kerola <kerolasa@iki.fi>