3 Commits
Author SHA1 Message Date
Marko Kohtala 35f3dc375b isotptun: add -D option to daemonize after tun device created
System startup needs to wait for tun device to be created before
continuing on use of the tun device. Add -D option to fork a daemon of
isotptun and exit(EXIT_SUCCESS) when the tun device can be used.

Log errors to syslog when daemonized or to stderr when in foreground.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:16:07 +02:00
Marko Kohtala 51192feff8 isotptun: print command line parsing error messages to stderr
Command line parsing error messages are printed to stdout. Other errors
and usage goes to stderr.

Change to print errors to stderr.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:14:29 +02:00
Marko Kohtala 7eb005d9f3 isotptun: use EXIT_FAILURE instead of 0 (EXIT_SUCCESS) for errors
Exit code does not tell if the service was provided or if it was not
provided due to command line or setup errors.

Change errors to return EXIT_FAILURE instead of 0. Also change other uses
of 0 to EXIT_SUCCESS and 1 to EXIT_FAILURE for clarity and POSIX
conformance.

Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com>
2017-02-14 11:12:51 +02:00