From 1b37f8b350c0ab8c7da9be5663da2bb68fc687cb Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 5 Mar 2014 10:59:27 +0100
Subject: Haiku compatibility hacks.


diff --git a/Makefile b/Makefile
index c7cc359..ff0313e 100644
--- a/Makefile
+++ b/Makefile
@@ -20,19 +20,19 @@ MANDIR = $(PREFIX)/share/man
 
 
 SHELL = /bin/sh
-INSTALL = install -o root
+INSTALL = install
 INSTALL_PROGRAM = $(INSTALL) -D
 INSTALL_DATA = $(INSTALL) -D -m0644 -g root
 INSTALL_DIR = $(INSTALL) -d -m0755 -g root
 CFLAGS ?= -O2
-CFLAGS += -Wall -Wstrict-prototypes -Wno-missing-field-initializers
+CFLAGS += -Wall -Wstrict-prototypes
 SRCS = main.c subs.c database.c job.c concat.c chuser.c
 OBJS = main.o subs.o database.o job.o concat.o chuser.o
 TABSRCS = crontab.c chuser.c
 TABOBJS = crontab.o chuser.o
 PROTOS = protos.h
 LIBS =
-LDFLAGS =
+LDFLAGS = -lbsd
 DEFS =  -DVERSION='"$(VERSION)"' \
 		-DSCRONTABS='"$(SCRONTABS)"' -DCRONTABS='"$(CRONTABS)"' \
 		-DCRONSTAMPS='"$(CRONSTAMPS)"' -DLOG_IDENT='"$(LOG_IDENT)"' \
diff --git a/main.c b/main.c
index 595f07a..cde23c8 100644
--- a/main.c
+++ b/main.c
@@ -234,10 +234,12 @@ main(int ac, char **av)
 
 		if (setsid() < 0)
 			perror("setsid");
+#ifndef __HAIKU__
 		if ((fd = open("/dev/tty", O_RDWR)) >= 0) {
 			ioctl(fd, TIOCNOTTY, 0);
 			close(fd);
 		}
+#endif
 
 		/* setup logging for backgrounded daemons */
 
-- 
1.8.3.4

