From db0f35fcee4d5dbad0662aed496b0bbf4eca0b4b Mon Sep 17 00:00:00 2001 From: Thibault Godouet Date: Wed, 11 Jan 2006 00:47:15 +0000 Subject: [PATCH] updated copyright --- allow.c | 4 ++-- allow.h | 4 ++-- conf.c | 4 ++-- conf.h | 4 ++-- convert-fcrontab.c | 8 ++++---- convert-fcrontab.h | 4 ++-- database.c | 4 ++-- database.h | 4 ++-- doc/en/thanks.sgml | 10 ++++++++-- dyncom.h | 4 ++-- fcron.c | 11 ++++++----- fcron.h | 4 ++-- fcrondyn.c | 8 ++++---- fcrondyn.h | 4 ++-- fcrontab.h | 4 ++-- fileconf.c | 5 ++--- fileconf.h | 4 ++-- getloadavg.c | 2 +- getloadavg.h | 4 ++-- global.h | 4 ++-- job.h | 4 ++-- log.c | 5 ++--- log.h | 4 ++-- option.h | 4 ++-- pam.h | 4 ++-- read_string.c | 5 ++--- read_string.h | 5 ++--- save.c | 5 ++--- save.h | 4 ++-- socket.c | 48 +++++++++++++++++++++++++++++++++++++--------- socket.h | 4 ++-- subs.h | 4 ++-- temp_file.c | 5 ++--- temp_file.h | 4 ++-- 34 files changed, 118 insertions(+), 87 deletions(-) diff --git a/allow.c b/allow.c index 555712b..4755647 100644 --- a/allow.c +++ b/allow.c @@ -2,7 +2,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: allow.c,v 1.14 2004-11-13 19:44:01 thib Exp $ */ + /* $Id: allow.c,v 1.15 2006-01-11 00:58:02 thib Exp $ */ #include "fcrontab.h" diff --git a/allow.h b/allow.h index 2f7f00a..8a82ba3 100644 --- a/allow.h +++ b/allow.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: allow.h,v 1.4 2003-12-25 22:52:59 thib Exp $ */ + /* $Id: allow.h,v 1.5 2006-01-11 00:58:09 thib Exp $ */ #ifndef __ALLOW_H__ #define __ALLOW_H__ diff --git a/conf.c b/conf.c index 174b8e9..7afee31 100644 --- a/conf.c +++ b/conf.c @@ -2,7 +2,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: conf.c,v 1.69 2005-06-11 22:51:05 thib Exp $ */ + /* $Id: conf.c,v 1.70 2006-01-11 00:53:20 thib Exp $ */ #include "fcron.h" diff --git a/conf.h b/conf.h index 682bb23..8d6d0bc 100644 --- a/conf.h +++ b/conf.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: conf.h,v 1.6 2003-12-25 22:44:34 thib Exp $ */ + /* $Id: conf.h,v 1.7 2006-01-11 00:53:37 thib Exp $ */ #ifndef __CONF_H__ #define __CONF_H__ diff --git a/convert-fcrontab.c b/convert-fcrontab.c index 3af1cbf..1a5ae40 100644 --- a/convert-fcrontab.c +++ b/convert-fcrontab.c @@ -2,7 +2,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,12 +22,12 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: convert-fcrontab.c,v 1.19 2004-07-11 18:09:41 thib Exp $ */ + /* $Id: convert-fcrontab.c,v 1.20 2006-01-11 00:54:22 thib Exp $ */ #include "convert-fcrontab.h" #include "global.h" -char rcs_info[] = "$Id: convert-fcrontab.c,v 1.19 2004-07-11 18:09:41 thib Exp $"; +char rcs_info[] = "$Id: convert-fcrontab.c,v 1.20 2006-01-11 00:54:22 thib Exp $"; void info(void); void usage(void); @@ -51,7 +51,7 @@ info(void) { fprintf(stderr, "convert-fcrontab "VERSION_QUOTED "\n" - "Copyright 2000-2004 Thibault Godouet \n" + "Copyright " COPYRIGHT_QUOTED " Thibault Godouet \n" "This program is free software distributed WITHOUT ANY WARRANTY.\n" "See the GNU General Public License for more details.\n" ); diff --git a/convert-fcrontab.h b/convert-fcrontab.h index ed80dd0..043896c 100644 --- a/convert-fcrontab.h +++ b/convert-fcrontab.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: convert-fcrontab.h,v 1.2 2003-12-25 22:52:00 thib Exp $ */ + /* $Id: convert-fcrontab.h,v 1.3 2006-01-11 00:54:25 thib Exp $ */ #ifndef __CONVERT_FCRONTAB_H__ #define __CONVERT_FCRONTAB_H__ diff --git a/database.c b/database.c index e637f41..5d5c280 100644 --- a/database.c +++ b/database.c @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: database.c,v 1.77 2005-07-19 13:08:20 thib Exp $ */ + /* $Id: database.c,v 1.78 2006-01-11 00:53:42 thib Exp $ */ #include "fcron.h" diff --git a/database.h b/database.h index ea5f643..77b2fcf 100644 --- a/database.h +++ b/database.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: database.h,v 1.8 2005-06-11 22:52:27 thib Exp $ */ + /* $Id: database.h,v 1.9 2006-01-11 00:53:48 thib Exp $ */ #ifndef __DATABASE_H__ #define __DATABASE_H__ diff --git a/doc/en/thanks.sgml b/doc/en/thanks.sgml index 0651aa9..38861f9 100644 --- a/doc/en/thanks.sgml +++ b/doc/en/thanks.sgml @@ -1,6 +1,6 @@ - + Thanks @@ -77,6 +77,12 @@ instance in a ppp-up script. and he wrote the patch for SE Linux support. + + Alain Portal + + Initial French translation of the manual pages. + + diff --git a/dyncom.h b/dyncom.h index 4495c58..fc31e88 100644 --- a/dyncom.h +++ b/dyncom.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: dyncom.h,v 1.5 2003-12-25 22:50:22 thib Exp $ */ + /* $Id: dyncom.h,v 1.6 2006-01-11 00:53:39 thib Exp $ */ /* This file describe the communication protocol between fcron and fcrondyn */ diff --git a/fcron.c b/fcron.c index b5ecc4b..65d83c5 100644 --- a/fcron.c +++ b/fcron.c @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcron.c,v 1.75 2005-07-19 10:40:08 thib Exp $ */ + /* $Id: fcron.c,v 1.76 2006-01-11 00:52:39 thib Exp $ */ #include "fcron.h" @@ -33,7 +33,7 @@ #include "socket.h" #endif -char rcs_info[] = "$Id: fcron.c,v 1.75 2005-07-19 10:40:08 thib Exp $"; +char rcs_info[] = "$Id: fcron.c,v 1.76 2006-01-11 00:52:39 thib Exp $"; void main_loop(void); void check_signal(void); @@ -124,7 +124,7 @@ info(void) { fprintf(stderr, "fcron " VERSION_QUOTED " - periodic command scheduler\n" - "Copyright 2000-2004 Thibault Godouet \n" + "Copyright " COPYRIGHT_QUOTED " Thibault Godouet \n" "This program is free software distributed WITHOUT ANY WARRANTY.\n" "See the GNU General Public License for more details.\n" ); @@ -730,8 +730,9 @@ main_loop() /* we set tv_usec to slightly more than necessary to avoid * infinite loop */ tv.tv_usec = 1001000 - tv.tv_usec; + /* note: read_set is set in socket.c */ if((retcode = select(set_max_fd+1, &read_set, NULL, NULL, &tv)) < 0 && errno != EINTR) - die_e("select return %d", errno); + die_e("select returned %d", errno); #else if (stime > 1) sleep(stime - 1); diff --git a/fcron.h b/fcron.h index 37bdee5..883d240 100644 --- a/fcron.h +++ b/fcron.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcron.h,v 1.32 2005-06-11 22:50:32 thib Exp $ */ + /* $Id: fcron.h,v 1.33 2006-01-11 00:53:01 thib Exp $ */ #ifndef __FCRON_H__ #define __FCRON_H__ diff --git a/fcrondyn.c b/fcrondyn.c index faf781d..a44e789 100644 --- a/fcrondyn.c +++ b/fcrondyn.c @@ -2,7 +2,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrondyn.c,v 1.13 2004-08-17 12:52:45 thib Exp $ */ + /* $Id: fcrondyn.c,v 1.14 2006-01-11 00:48:33 thib Exp $ */ /* fcrondyn : interact dynamically with running fcron process : * - list jobs, with their status, next time of execution, etc @@ -35,7 +35,7 @@ #include "allow.h" #include "read_string.h" -char rcs_info[] = "$Id: fcrondyn.c,v 1.13 2004-08-17 12:52:45 thib Exp $"; +char rcs_info[] = "$Id: fcrondyn.c,v 1.14 2006-01-11 00:48:33 thib Exp $"; void info(void); void usage(void); @@ -104,7 +104,7 @@ info(void) { fprintf(stderr, "fcrondyn " VERSION_QUOTED " - interact dynamically with daemon fcron\n" - "Copyright 2000-2004 Thibault Godouet \n" + "Copyright " COPYRIGHT_QUOTED " Thibault Godouet \n" "This program is free software distributed WITHOUT ANY WARRANTY.\n" "See the GNU General Public License for more details.\n" ); diff --git a/fcrondyn.h b/fcrondyn.h index 91b14e9..97eb0f9 100644 --- a/fcrondyn.h +++ b/fcrondyn.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrondyn.h,v 1.4 2005-02-26 15:09:54 thib Exp $ */ + /* $Id: fcrondyn.h,v 1.5 2006-01-11 00:49:26 thib Exp $ */ #ifndef __FCRONDYN_H__ #define __FCRONDYN_H__ diff --git a/fcrontab.h b/fcrontab.h index 21f0eff..bd315fe 100644 --- a/fcrontab.h +++ b/fcrontab.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fcrontab.h,v 1.18 2003-12-25 22:42:53 thib Exp $ */ + /* $Id: fcrontab.h,v 1.19 2006-01-11 00:51:17 thib Exp $ */ #ifndef __FCRONTAB_H__ #define __FCRONTAB_H__ diff --git a/fileconf.c b/fileconf.c index d1fc929..4a4cc86 100644 --- a/fileconf.c +++ b/fileconf.c @@ -1,8 +1,7 @@ - /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fileconf.c,v 1.75 2005-06-11 22:50:41 thib Exp $ */ + /* $Id: fileconf.c,v 1.76 2006-01-11 00:53:05 thib Exp $ */ #include "fcrontab.h" diff --git a/fileconf.h b/fileconf.h index 7118f8f..99d8118 100644 --- a/fileconf.h +++ b/fileconf.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: fileconf.h,v 1.5 2003-12-25 22:43:51 thib Exp $ */ + /* $Id: fileconf.h,v 1.6 2006-01-11 00:53:12 thib Exp $ */ #ifndef __FILECONF_H__ #define __FILECONF_H__ diff --git a/getloadavg.c b/getloadavg.c index ce26861..b67d017 100644 --- a/getloadavg.c +++ b/getloadavg.c @@ -1,7 +1,7 @@ /* * gloadavg.c - get load average for Linux * Copyright (C) 1993 Thomas Koenig - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/getloadavg.h b/getloadavg.h index afb89e5..0773fb0 100644 --- a/getloadavg.h +++ b/getloadavg.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: getloadavg.h,v 1.4 2003-12-25 22:53:08 thib Exp $ */ + /* $Id: getloadavg.h,v 1.5 2006-01-11 00:58:13 thib Exp $ */ #ifndef __GETLOADAVG_H__ #define __GETLOADAVG_H__ diff --git a/global.h b/global.h index 4143a06..78db5b1 100644 --- a/global.h +++ b/global.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: global.h,v 1.45 2005-06-11 22:50:54 thib Exp $ */ + /* $Id: global.h,v 1.46 2006-01-11 00:53:14 thib Exp $ */ /* diff --git a/job.h b/job.h index 4e3b2c8..634f901 100644 --- a/job.h +++ b/job.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: job.h,v 1.7 2003-12-25 22:40:59 thib Exp $ */ + /* $Id: job.h,v 1.8 2006-01-11 00:47:15 thib Exp $ */ #ifndef __JOB_H__ #define __JOB_H__ diff --git a/log.c b/log.c index 9c62ec3..b75539e 100644 --- a/log.c +++ b/log.c @@ -1,8 +1,7 @@ - /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: log.c,v 1.15 2004-08-17 12:49:19 thib Exp $ */ + /* $Id: log.c,v 1.16 2006-01-11 00:48:09 thib Exp $ */ /* This code is inspired by Anacron's sources of Itai Tzur */ diff --git a/log.h b/log.h index 4a9d3d2..5a269d6 100644 --- a/log.h +++ b/log.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: log.h,v 1.7 2004-08-12 09:41:31 thib Exp $ */ + /* $Id: log.h,v 1.8 2006-01-11 00:48:18 thib Exp $ */ #ifndef __LOG_H__ #define __LOG_H__ diff --git a/option.h b/option.h index bcfde9f..e7ea552 100644 --- a/option.h +++ b/option.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: option.h,v 1.23 2003-12-25 22:53:10 thib Exp $ */ + /* $Id: option.h,v 1.24 2006-01-11 00:58:14 thib Exp $ */ /* This has been inspired from bitstring(3) : here is the original copyright : */ diff --git a/pam.h b/pam.h index 0c6fbad..875931c 100644 --- a/pam.h +++ b/pam.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: pam.h,v 1.3 2003-12-25 22:41:15 thib Exp $ */ + /* $Id: pam.h,v 1.4 2006-01-11 00:48:31 thib Exp $ */ #ifndef __PAM_H__ #define __PAM_H__ diff --git a/read_string.c b/read_string.c index d3f3951..d913e81 100644 --- a/read_string.c +++ b/read_string.c @@ -1,8 +1,7 @@ - /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: read_string.c,v 1.2 2003-12-25 22:42:38 thib Exp $ */ + /* $Id: read_string.c,v 1.3 2006-01-11 00:49:29 thib Exp $ */ /* read a string (password, etc ...) securely from a tty */ diff --git a/read_string.h b/read_string.h index f37ea90..23cce50 100644 --- a/read_string.h +++ b/read_string.h @@ -1,8 +1,7 @@ - /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: read_string.h,v 1.2 2003-12-25 22:42:43 thib Exp $ */ + /* $Id: read_string.h,v 1.3 2006-01-11 00:49:31 thib Exp $ */ #ifndef __READ_STRING_H__ #define __READ_STRING_H__ diff --git a/save.c b/save.c index 93c30ce..3693639 100644 --- a/save.c +++ b/save.c @@ -1,8 +1,7 @@ - /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: save.c,v 1.10 2005-06-11 22:52:32 thib Exp $ */ + /* $Id: save.c,v 1.11 2006-01-11 00:54:27 thib Exp $ */ #include "global.h" #include "save.h" diff --git a/save.h b/save.h index 71708c7..3b491ad 100644 --- a/save.h +++ b/save.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: save.h,v 1.11 2005-06-11 22:53:10 thib Exp $ */ + /* $Id: save.h,v 1.12 2006-01-11 00:54:34 thib Exp $ */ #ifndef __SAVE_H__ #define __SAVE_H__ diff --git a/socket.c b/socket.c index 8868326..38f1c6a 100644 --- a/socket.c +++ b/socket.c @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: socket.c,v 1.18 2005-06-11 22:54:33 thib Exp $ */ + /* $Id: socket.c,v 1.19 2006-01-11 00:58:21 thib Exp $ */ /* This file contains all fcron's code (server) to handle communication with fcrondyn */ @@ -44,6 +44,8 @@ void cmd_renice(struct fcrondyn_cl *client, long int *cmd, int fd, int exe_index int is_root); void cmd_send_signal(struct fcrondyn_cl *client, long int *cmd, int fd, int exe_index); void cmd_run(struct fcrondyn_cl *client, long int *cmd, int fd, int is_root); +void add_to_select_set(int fd, fd_set *set, int *max_fd); +void remove_from_select_set(int fd, fd_set *set, int *max_fd); fcrondyn_cl *fcrondyn_cl_base; /* list of connected fcrondyn clients */ int fcrondyn_cl_num = 0; /* number of fcrondyn clients currently connected */ @@ -94,6 +96,38 @@ char err_others_nallowed_str[] = "You are not allowed to list other users' jobs. /* the number of char we need (8 bits (i.e. fields) per char) */ #define FIELD_NUM_SIZE 1 + +void +add_to_select_set(int fd, fd_set *set, int *max_fd) + /* add fd to set, and update max_fd if necessary (for select()) */ +{ + FD_SET(fd, set); + if ( fd > *max_fd ) + *max_fd = fd; +} + + +void +remove_from_select_set(int fd, fd_set *set, int *max_fd) + /* remove fd to set, and update max_fd if necessary (for select()) */ +{ + FD_CLR(fd, set); + if ( fd == *max_fd ) { + /* find the biggest fd in order to update max_fd */ + struct fcrondyn_cl *client; + int tmp_max_fd = listen_fd; + + for ( client = fcrondyn_cl_base; client != NULL; client = client->fcl_next) { + if ( client->fcl_sock_fd > tmp_max_fd ) + tmp_max_fd = client->fcl_sock_fd; + } + + /* update max_fd */ + *max_fd = tmp_max_fd; + } +} + + void init_socket(void) /* do everything needed to get a working listening socket */ @@ -142,9 +176,7 @@ init_socket(void) } /* no error */ - FD_SET(listen_fd, &master_set); - if ( listen_fd > set_max_fd ) - set_max_fd = listen_fd; + add_to_select_set(listen_fd, &master_set, &set_max_fd); /* copy master in read_fs, because read_fs will be modified by select() */ read_set = master_set; @@ -703,7 +735,7 @@ and make client points to the next entry */ { shutdown((*client)->fcl_sock_fd, SHUT_RDWR); close((*client)->fcl_sock_fd); - FD_CLR((*client)->fcl_sock_fd, &master_set); + remove_from_select_set((*client)->fcl_sock_fd, &master_set, &set_max_fd); debug("connection closed : fd : %d", (*client)->fcl_sock_fd); if (prev_client == NULL ) { fcrondyn_cl_base = (*client)->fcl_next; @@ -764,9 +796,7 @@ check_socket(int num) /* to avoid trying to read from it in this call */ avoid_fd = fd; - FD_SET(fd, &master_set); - if ( fd > set_max_fd ) - set_max_fd = fd; + add_to_select_set(fd, &master_set, &set_max_fd); fcrondyn_cl_num += 1; debug("Added connection fd : %d - %d connections", fd, fcrondyn_cl_num); diff --git a/socket.h b/socket.h index b262964..4ef9002 100644 --- a/socket.h +++ b/socket.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: socket.h,v 1.4 2003-12-25 22:57:33 thib Exp $ */ + /* $Id: socket.h,v 1.5 2006-01-11 00:58:31 thib Exp $ */ /* This file describe the communication protocol between fcron and fcrondyn */ diff --git a/subs.h b/subs.h index 765bb76..5354c48 100644 --- a/subs.h +++ b/subs.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: subs.h,v 1.8 2004-04-29 19:36:38 thib Exp $ */ + /* $Id: subs.h,v 1.9 2006-01-11 00:57:59 thib Exp $ */ #ifndef __SUBS_H__ #define __SUBS_H__ diff --git a/temp_file.c b/temp_file.c index e758295..65e2489 100644 --- a/temp_file.c +++ b/temp_file.c @@ -1,8 +1,7 @@ - /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: temp_file.c,v 1.4 2005-02-26 15:15:03 thib Exp $ */ + /* $Id: temp_file.c,v 1.5 2006-01-11 00:54:06 thib Exp $ */ #include "global.h" #include "temp_file.h" diff --git a/temp_file.h b/temp_file.h index 71d197b..4e6f0d1 100644 --- a/temp_file.h +++ b/temp_file.h @@ -1,7 +1,7 @@ /* * FCRON - periodic command scheduler * - * Copyright 2000-2004 Thibault Godouet + * Copyright 2000-2006 Thibault Godouet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: temp_file.h,v 1.2 2003-12-25 22:51:53 thib Exp $ */ + /* $Id: temp_file.h,v 1.3 2006-01-11 00:54:08 thib Exp $ */ #ifndef __TEMP_FILE_H__ #define __TEMP_FILE_H__ -- 2.47.3