Slight patch for Cron

Ronald Landheer-Cieslak ronald@landheer.com
Tue Jun 3 08:33:00 GMT 2003


I've "developed" an insignificant patch to cron (attached) that makes cron 
detach from the console before forking out (under Cygwin only). The patch 
is against the current release's source and WFM.

In fact, my "problem" was that when starting cron from the "startup 
programs", a console window stuck around. This fixes that.

HTH

rlc

-------------- next part --------------
diff -burp cron-3.0.1-9-orig/cron.c cron-3.0.1-9/cron.c
--- cron-3.0.1-9-orig/cron.c    2003-06-03 10:16:36.000000000 +0200
+++ cron-3.0.1-9/cron.c 2003-06-03 10:20:18.000000000 +0200
@@ -25,6 +25,7 @@ static const char rcsid[] = "$Id: cron.c
 
 #include "cron.h"
 #ifdef __CYGWIN__
+#include <windows.h>
 #include <signal.h>
 #else
 #include <sys/signal.h>
@@ -98,6 +99,10 @@ main(argc, argv)
 # endif
                (void) fprintf(stderr, "[%d] cron started\n", getpid());
        } else {
+#if __CYGWIN__
+               // RLC 2003-06-03 Detach from console
+               FreeConsole();
+#endif
                switch (fork()) {
                case -1:
                        log_it("CRON",getpid(),"DEATH","can't fork");

-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list