~vcs-imports/gpsd/master

Viewing all changes in revision 13500.

  • Committer: Fred Wright
  • Date: 2019-03-22 03:04:46 UTC
  • Revision ID: git-v1:3d1b7493c58f80a93b9bbec33717fd3055841ae1
os_compat: OSX daemon() warning fix.

OSX considers the daemon() call deprecated.  This is mainly because
real OSX daemons are expected to run as launchd children, but since
some programs here daemonize for convenience, and since
self-daemonization is sometimes useful for testing, we can't really
get rid of it.  Previous work consolidated daemon() calls into
os_compat, reducing the number of warnings, and this change gets rid
of them altogether.

There doesn't seem to be any easy way to avoid the warnings except
by avoiding the normal declaration of daemon(), which is what we
do here by duplicating it locally.

If daemon() ever actually disappears, it could be reintroduced
via the usual double-fork approach.

TESTED:
Ran "build-all check" as well as testing daemonization on a Mac Pro
10.9 and 10.14, MacBook Pro 10.9, PowerBook 10.5, and VMs for OSX
10.5-10.13, Ubuntu 14.04, CentOS 7, Fedora 25, FreeBSD 10.3, OpenBSD
5.6 (64- and 32-bit), and NetBSD 6.1.5.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: