Don't call daemon() in cron on Fuchsia
Change-Id: If7a9fb468f48613e634295641a8eff097c483c5d
diff --git a/cron.c b/cron.c
index 77304cc..50ff4de 100644
--- a/cron.c
+++ b/cron.c
@@ -508,7 +508,12 @@
if (nflag == 0) {
openlog(argv[0], LOG_CONS | LOG_PID, LOG_CRON);
- if (daemon(1, 0) < 0) {
+ // TODO(kulakowski) Allow this to go the background in
+ // a fuchsia-idiomatic way. Relying on daemon(3), with
+ // it's fork-dependent semantics, won't work.
+ const int backgrounding_succeeded = 0;
+ errno = ENOSYS;
+ if (!backgrounding_succeeded) {
logerr("error: failed to daemonize %s\n", strerror(errno));
return 1;
}