On the E100, and possibly other systems, OpenBTS seg faults
at startup. The cause is a null reference to the global
logging file descriptor occuring due to an initializer order
dependency, which is not guaranteed across compilation
units.
When this occurs, check for for null and set the output to
stdout.
Signed-off-by: Thomas Tsou <ttsou@vt.edu>
I don't see real value of this message, while it's been printed to the screen like something very important.
(cherry picked from commit 3f3c9b2d2599a672f08624b3081c2c687cbba4d4)
gethostbyname() is not thread-safe. It's recommended to use gethostbyname_r() or gethostbyname2_r() instead.
(cherry picked from commit f27e9581cdb6837f83d0aab467f0e5f83e814e7b)
This time I checked all occurrences of assert() and all others are ok, if I didn't miss anything
(cherry picked from commit 2afd3fd962eb89e08a73420542267191f459815f)
If you compile with optimization and NDEBUG is defined, then the whole assert() is replaced with ((void) 0) and your code is not executed at all.
Don't assert() on pthread_join() return value. If thread was not started yet, then pthread_join() will fail, but it's ok for us.
(cherry picked from commit d0b797e62c, 21a84dcec9cdf25657bba5c221aac9d4bb81d8b3, 8ed37a1f36e1b1266728647e715f95a28df3f900)
Subtracting uint32_t from uin32_t gives you uint32_t. And assigning result to a long doesn't make it a signed value, because on 64-bit Linux long is 64 bits.
(cherry picked from commit 82dd78d698)
Best practice is to not include those in repositories but only
in tar.gz dist tarball.
autoreconf -i will regenerate them
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>