delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/06/10/05:53:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 10 Jun 2003 11:52:57 +0200 (MEST)
From: Bjoern Kahl AG Resy <kahl AT informatik DOT uni-kl DOT de>
To: cygwin AT cygwin DOT com
Subject: Re: Slight patch for Cron
In-Reply-To: <Pine.LNX.4.44.0306101118230.850-100000@localhost.localdomain>
Message-ID: <Pine.GSO.4.53.0306101145050.1165@domino.informatik.uni-kl.de>
References: <Pine DOT LNX DOT 4 DOT 44 DOT 0306101118230 DOT 850-100000 AT localhost DOT localdomain>
MIME-Version: 1.0

 ( replying to the wrong mail-in-thread )
 ( because missed the original posting  )


On Tue, 10 Jun 2003, Ronald Landheer-Cieslak wrote:

> > Index: cron.c
> > ===================================================================
> > RCS file: /home/cvs/cvsroot/src/cron/cron.c,v
> > retrieving revision 1.5
> > diff -p -u -r1.5 cron.c
> > --- cron.c	11 Apr 2003 19:42:37 -0000	1.5
> > +++ cron.c	6 Jun 2003 07:13:17 -0000
> > @@ -26,6 +26,7 @@ static const char rcsid[] = "$Id: cron.c
> >  #include "cron.h"
> >  #ifdef __CYGWIN__
> >  #include <signal.h>
> > +#include <sys/fcntl.h>
> >  #else
> >  #include <sys/signal.h>
> >  #endif
> > @@ -115,6 +116,21 @@ main(argc, argv)
> >  	}
> >
> >  	acquire_daemonlock(0);
> > +
> > +#ifdef __CYGWIN__
> > +	{
> > +	  int fd;
> > +	  if ((fd = open("/dev/null", O_RDWR, 0)) != -1)
> > +	    {
> > +	      (void)dup2(fd, STDIN_FILENO);
> > +	      (void)dup2(fd, STDOUT_FILENO);
> > +	      (void)dup2(fd, STDERR_FILENO);
> > +	      if (fd > 2)
> > +		(void)close (fd);

 Should not this read :

   if ( (fd != STDIN_FILENO) && (fd != STDOUT_FILENO) & .. )

 If you already use symbolic constants for the file descriptors?
 Just imagine a weird system, having e.g. STDOUT_FILENO defined
 as 3. (I doubt, something like that exist, but who knows?)


> > +	    }
> > +	}
> > +#endif
> > +
> >  	database.head = NULL;


  Bjoern

P.S.: No nothing bad intended, it just looks - hmm - unusual.
-- 
+---------------------------------------------------------------------+
| Dipl.-Phys. Bjoern Kahl +++ AG Embedded Systems and Robotics (RESY) |
| Informatics Faculty +++ Building 48 +++ University of Kaiserslautern|
| phone: +49-631-205-2654 +++ www: http://resy.informatik.uni-kl.de   |
+---------------------------------------------------------------------+

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019