* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: fileconf.c,v 1.3 2000-05-30 19:27:26 thib Exp $ */
+ /* $Id: fileconf.c,v 1.4 2000-06-10 22:16:44 thib Exp $ */
#include "fcrontab.h"
Alloc(cl, CL);
ptr++;
- /* get cl_remain field */
- ptr = get_time(ptr, &(cl->cl_remain), line, file_name);
+ /* get the time before first execution */
+ ptr = get_time(ptr, &(cl->cl_nextexe), line, file_name);
Skip_blanks(ptr);
return;
}
- if ( cl->cl_remain == 0 )
- /* cl_remain is not specified : set it to cl_timefreq value */
- cl->cl_remain = cl->cl_timefreq;
+ if ( cl->cl_nextexe == 0 )
+ /* time before first execution is not specified */
+ cl->cl_nextexe = cl->cl_timefreq;
+
+
/* get cl_shell field ( remove trailing blanks ) */
if ( (cl->cl_shell = get_string(ptr)) == NULL ) {
if ( debug_opt )
fprintf(stderr, " Cmd '%s', timefreq %ld, remain %ld\n",
- cl->cl_shell, cl->cl_timefreq, cl->cl_remain);
+ cl->cl_shell, cl->cl_timefreq, cl->cl_nextexe);
}
if (debug_opt)
/* if debug_opt is set, we print informations in read_field function,
* but no end line : we print it here */
- fprintf(stderr, " remain %ld\n", cl->cl_remain);
+ fprintf(stderr, " remain %d\n", cl->cl_remain);
/* get the shell command (remove trailing blanks) */
if ( (cl->cl_shell = get_string(ptr)) == NULL ) {
if ( isalpha(*ptr) ) {
int i;
+ if ( names == NULL )
+ return NULL;
+
/* set string to lower case */
for ( i = 0; i < strlen(names[0]); i++ )
*(ptr+i) = tolower( *(ptr+i) );
* if the syntax has changed */
fprintf(f, "fcrontab-" FILEVERSION "\n");
+ /* put the time & date of saving : this is use for calcutating
+ * the system down time. As it is a new file, we set it to 0 */
+ fprintf(f, "%d", 0);
+
/* mailto, */
if ( file->cf_mailto != NULL ) {
fprintf(f, "m");