* Fix pthread_setname_np detection
Commit 6617c6f2c8 replaced
AC_LINK_IFELSE with AC_COMPILE_IFELSE. This has broken the
pthread_setname_np detection as compilation will always succeed even if
pthread_setname_np is not available (if the function is not found, a
simple warning will be displayed in config.log).
The correct fix is to put back AC_LINK_IFELSE with -pthread in LIBS
otherwise compilation will fail on toolchain without pthread_setname_np.
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* Check for pthread_getname_np
On some toolchains (like musl), pthread_setname_np is available but not
pthread_getname_np so add this check in configure.ac
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* Revision for detection of XSI vs GNU variants of strerror
pthread_setname_np is a nonstandard GNU extension so put back its
detection, deleted by commit ab5835d435,
to be able to cross-compile motion with non glibc toolchains
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* Use openlog() and closelog() so that we don't leak a file descriptor
(hello Valgrind) when the program exits in syslog mode
* Update comments to reflect actual log text being generated
* Moved va_end() closer to its corresponding va_start()
* Define new LOGMODE_NONE mode so that we can close out logging
completely at program end
We add a simple wrapper #define to hide the difference between the
Mac and other platforms version of this function. The tests should
cover all our supported platforms, so remove the configure test.
As the logging currently is, you can't see whether log messages came
from the netcam thread or the motion loop thread, and messages that
come from the ffmpeg thread appear to come from the main thread. This
makes debugging based on the log messages error prone at best.
As an added bonus any camera name is now included.