summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/crontab.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-11-04 20:28:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-11-04 20:28:18 +0000
commitd3037ce85fdf672ecf23feb9122711d0bfff6ad9 (patch)
tree78f10e62a05c58c3281b29ece05db3bf5c93d5c2 /usr.sbin/cron/crontab.c
parent5fc6bd7c6445514ec75f98c8790517cb902f2176 (diff)
Change cron from including all headers in every file to only including
what each .c file needs. I have not removed cron.h since it will be used in a future clean up of the cron's .h files. OK nicm@
Diffstat (limited to 'usr.sbin/cron/crontab.c')
-rw-r--r--usr.sbin/cron/crontab.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c
index b6fee330734..afb38e10114 100644
--- a/usr.sbin/cron/crontab.c
+++ b/usr.sbin/cron/crontab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crontab.c,v 1.81 2015/11/03 21:10:08 millert Exp $ */
+/* $OpenBSD: crontab.c,v 1.82 2015/11/04 20:28:17 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -17,18 +17,34 @@
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <err.h>
-
#define MAIN_PROGRAM
-#include "cron.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+
+#include <bitstring.h> /* for structs.h */
+#include <err.h>
+#include <errno.h>
+#include <locale.h>
+#include <pwd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "pathnames.h"
+#include "macros.h"
+#include "structs.h"
+#include "funcs.h"
+#include "globals.h"
#define NHEADER_LINES 3
enum opt_t { opt_unknown, opt_list, opt_delete, opt_edit, opt_replace };
-static char *getoptargs = "u:ler";
-
static pid_t Pid;
static gid_t crontab_gid;
static gid_t user_gid;
@@ -133,7 +149,7 @@ parse_args(int argc, char *argv[])
strlcpy(RealUser, User, sizeof(RealUser));
Filename[0] = '\0';
Option = opt_unknown;
- while (-1 != (argch = getopt(argc, argv, getoptargs))) {
+ while ((argch = getopt(argc, argv, "u:ler")) != -1) {
switch (argch) {
case 'u':
if (getuid() != 0) {