summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0334d1b)
raw | patch | inline | side by side (parent: 0334d1b)
author | octo <octo> | |
Tue, 10 Jan 2006 21:58:22 +0000 (21:58 +0000) | ||
committer | octo <octo> | |
Tue, 10 Jan 2006 21:58:22 +0000 (21:58 +0000) |
- Corrected ChangeLog
- Added comments and TODOs to `configfile.c'
- ``corrected'' indentation in `common.c'
- Added comments and TODOs to `configfile.c'
- ``corrected'' indentation in `common.c'
ChangeLog | patch | blob | history | |
src/common.c | patch | blob | history | |
src/configfile.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 8b959cdbc1b8c04fcebacf9a76b113c954755127..f4d3ce2a23f6dc911eb08e3bbe7a28010cfec4a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
plugins.
* A `df' plugin has been added.
* A `mysql' plugin has been added.
- * A signal handler for SIGTERM has been added. Signal handlers have
- been improved, too.
2005-12-18, Version 3.5.1
* The PID-file is now deleted correctly when shutting down the daemon.
diff --git a/src/common.c b/src/common.c
index 4d93f4aa2764f5394c2336a3db889ebecc87d24c..43a51a57c5aa7db29ec401852d8919a66404611b 100644 (file)
--- a/src/common.c
+++ b/src/common.c
static int rra_num = 9;
#endif /* HAVE_LIBRRD */
-void
-sstrncpy(char *d, const char *s, int len)
+void sstrncpy (char *d, const char *s, int len)
{
- strncpy(d, s, len);
- d[len - 1] = 0;
+ strncpy (d, s, len);
+ d[len - 1] = '\0';
}
-char *
-sstrdup(const char *s)
+char *sstrdup (const char *s)
{
- char *r = strdup(s);
- if(r == NULL) {
- DBG("Not enough memory.");
+ char *r;
+
+ if((r = strdup (s)) == NULL)
+ {
+ DBG ("Not enough memory.");
exit(3);
}
- return r;
+
+ return (r);
}
-void *
-smalloc(size_t size)
+void *smalloc (size_t size)
{
- void *r = malloc(size);
- if(r == NULL) {
+ void *r;
+
+ if ((r = malloc (size)) == NULL)
+ {
DBG("Not enough memory.");
exit(3);
}
+
return r;
}
+#if 0
+void sfree (void **ptr)
+{
+ if (ptr == NULL)
+ return;
+
+ if (*ptr != NULL)
+ free (*ptr);
+
+ *ptr = NULL;
+}
+#endif
+
int strsplit (char *string, char **fields, size_t size)
{
size_t i;
diff --git a/src/configfile.c b/src/configfile.c
index 9b1b83a163533bb3e3848ece22997914d6324f68..e3341dd4fed39a68c886b76fca981a0ce5de1d20 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
int mode;
} cf_mode_item_t;
+/* TODO
+ * - LogFile
+ * - DontFork
+ */
static cf_mode_item_t cf_mode_list[] =
{
{"Server", NULL, MODE_CLIENT },
return (LC_CBRET_OKAY);
}
-/* XXX think about how to do the command line stuff */
+/*
+ * `cf_callback_mode_switch'
+ * Change the contents of the global variable `operating_mode'
+ *
+ * This should be command line options. One *can* do this in the config
+ * files, but I will not document this. Don't whine abount it not working as
+ * you expect if you do it anyways.
+ */
int cf_callback_mode_switch (const char *shortvar, const char *var,
const char *arguments, const char *value, lc_flags_t flags,
void *extra)