dist_pam_DATA = pam/crond
endif
-EXTRA_DIST = cronie.init crond.sysconfig contrib/anacrontab \
- contrib/0anacron contrib/0hourly \
- contrib/dailyjobs contrib/cronie.systemd
+dist_noinst_HEADERS = \
+ cronie_common.h
+
+EXTRA_DIST = \
+ cronie.init \
+ crond.sysconfig \
+ contrib/anacrontab \
+ contrib/0anacron \
+ contrib/0hourly \
+ contrib/dailyjobs \
+ contrib/cronie.systemd
--- /dev/null
+/*
+ * Copyright (c) 2012 Copyright Red Hat Software
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* Collection of definitions, inline functions, etc, that are useful for
+ * both cron and anacron. */
+
+#ifndef CRONIE_COMMON_H
+#define CRONIE_COMMON_H
+
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+# define __attribute__(x) /* empty */
+# endif
+#endif
+
+#ifndef ATTRIBUTE_NORETURN
+# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif
+
+#ifndef ATTRIBUTE_UNUSED
+# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif
+
+#endif /* CRONIE_COMMON_H */
# include <sys/fcntl.h>
#endif
+#include "cronie_common.h"
#include "funcs.h"
#include "globals.h"
#include "pathnames.h"
enum timejump { negative, small, medium, large };
-static void usage(void),
+static void usage(void) ATTRIBUTE_NORETURN,
run_reboot_jobs(cron_db *),
find_jobs(int, cron_db *, int, int, long),
set_time(int),
# include <selinux/av_permissions.h>
#endif
+#include "cronie_common.h"
#include "bitstring.h"
#include "externs.h"
#include "funcs.h"
delete_cmd(void),
edit_cmd(void),
poke_daemon(void),
-check_error(const char *), parse_args(int c, char *v[]), die(int);
+check_error(const char *), parse_args(int c, char *v[]), die(int) ATTRIBUTE_NORETURN;
static int replace_cmd(void), hostset_cmd(void), hostget_cmd(void);
static char *host_specific_filename(const char *filename, int prefix);
static const char *tmp_path(void);
+static void usage(const char *msg) ATTRIBUTE_NORETURN;
static void usage(const char *msg) {
fprintf(stderr, "%s: usage error: %s\n", ProgramName, msg);
fprintf(stderr, "Usage:\n");
#include <stdlib.h>
#include <string.h>
+#include "cronie_common.h"
#include "funcs.h"
#include "globals.h"
+#include "macros.h"
#ifdef WITH_PAM
# include <security/pam_appl.h>
static int
cron_conv(int num_msg, const struct pam_message **msgm,
- struct pam_response **response, void *appdata_ptr)
+ struct pam_response **response ATTRIBUTE_UNUSED,
+ void *appdata_ptr ATTRIBUTE_UNUSED)
{
int i;
#endif
}
-int cron_set_job_security_context(entry * e, user * u, char ***jobenv) {
+int cron_set_job_security_context(entry *e, user *u ATTRIBUTE_UNUSED,
+ char ***jobenv) {
time_t minutely_time = 0;
#ifdef WITH_PAM
int ret;