AboutSummaryRefsLogTreeCommitDiffStats
path: root/mcron.c.template
diff options
context:
space:
mode:
authordale_mellor <dale_mellor>2005-10-23 12:29:19 +0000
committerdale_mellor <dale_mellor>2005-10-23 12:29:19 +0000
commitb1e921ffc81d460ef0ed7ab6163eb38b654ddf3b (patch)
tree4d5a51b409075d5c1617b7cab96a3b863d0b4f2a /mcron.c.template
parent863b755293610f84bc0f871264195076f99a9392 (diff)
downloadmcron-1.0.2.rc1.tar.gz
mcron-1.0.2.rc1.tar.bz2
mcron-1.0.2.rc1.zip
Changes requested by David D. Smith.1.0.2.rc1
Non-root install.
Diffstat (limited to 'mcron.c.template')
-rw-r--r--mcron.c.template49
1 files changed, 28 insertions, 21 deletions
diff --git a/mcron.c.template b/mcron.c.template
index d99e492..4612f67 100644
--- a/mcron.c.template
+++ b/mcron.c.template
@@ -62,10 +62,11 @@
which are supposed to initiate shutdown of this program. It calls the scheme
procedure (see mcron.scm for details) to do all the work, and then exits. */
-void react_to_terminal_signal (int sig)
+void
+react_to_terminal_signal (int sig)
{
- scm_eval_string (scm_take0str ("(delete-run-file)") );
- exit (1);
+ scm_eval_string (scm_take0str ("(delete-run-file)") );
+ exit (1);
}
@@ -73,17 +74,18 @@ void react_to_terminal_signal (int sig)
/* This is a function designed to be callable from scheme, and sets up all the
signal handlers required by the cron personality. */
-SCM set_cron_signals ()
+SCM
+set_cron_signals ()
{
- static struct sigaction sa;
- memset (&sa, 0, sizeof (sa));
- sa.sa_handler = react_to_terminal_signal;
- sigaction (SIGTERM, &sa, 0);
- sigaction (SIGINT, &sa, 0);
- sigaction (SIGQUIT, &sa, 0);
- sigaction (SIGHUP, &sa, 0);
-
- return SCM_BOOL_T;
+ static struct sigaction sa;
+ memset (&sa, 0, sizeof (sa));
+ sa.sa_handler = react_to_terminal_signal;
+ sigaction (SIGTERM, &sa, 0);
+ sigaction (SIGINT, &sa, 0);
+ sigaction (SIGQUIT, &sa, 0);
+ sigaction (SIGHUP, &sa, 0);
+
+ return SCM_BOOL_T;
}
@@ -92,21 +94,26 @@ SCM set_cron_signals ()
register the function above with the guile system, and then execute the mcron
guile program. */
-void inner_main ()
+void
+inner_main ()
{
- scm_c_define_gsubr ("c-set-cron-signals", 0, 0, 0, set_cron_signals);
+ scm_c_define_gsubr ("c-set-cron-signals", 0, 0, 0, set_cron_signals);
- scm_eval_string (scm_take0str (
- GUILE_PROGRAM_GOES_HERE
- ) );
+ scm_eval_string (scm_take0str (
+ GUILE_PROGRAM_GOES_HERE
+ ) );
}
/* The real main function. Does nothing but start up the guile subsystem. */
-int main (int argc, char **argv)
+int
+main (int argc, char **argv)
{
- scm_boot_guile (argc, argv, inner_main, 0);
- return 0;
+ setenv ("GUILE_LOAD_PATH", GUILE_LOAD_PATH, 1);
+
+ scm_boot_guile (argc, argv, inner_main, 0);
+
+ return 0;
}