summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-01-17 19:29:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-01-17 19:29:07 +0000
commitc293e4c0ba3b56fdbf23088349df21725ff16aee (patch)
tree7e99ed917c0c26dca37898866b80974f27e5f02d
parent02eeabc4c9a749a24baf25cbe002ed45f42bbca7 (diff)
remove stdio code from handler, and _exit() at termination
-rw-r--r--usr.bin/at/at.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index 79edcef3a7a..ee1dbfd00a6 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: at.c,v 1.19 2000/04/23 16:32:07 millert Exp $ */
+/* $OpenBSD: at.c,v 1.20 2001/01/17 19:29:06 deraadt Exp $ */
/* $NetBSD: at.c,v 1.4 1995/03/25 18:13:31 glass Exp $ */
/*
@@ -74,7 +74,7 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */
/* File scope variables */
#ifndef lint
-static char rcsid[] = "$OpenBSD: at.c,v 1.19 2000/04/23 16:32:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: at.c,v 1.20 2001/01/17 19:29:06 deraadt Exp $";
#endif
char *no_export[] =
@@ -115,15 +115,25 @@ sigc(signo)
PRIV_END
}
- exit(EXIT_FAILURE);
+ _exit(EXIT_FAILURE);
}
static void
alarmc(signo)
int signo;
{
+ char buf[1024];
+
/* Time out after some seconds. */
- panic("File locking timed out");
+ strlcpy(buf, namep, sizeof(buf));
+ strlcat(buf, ": File locking timed out\n", sizeof(buf));
+ write(STDERR_FILENO, buf, strlen(buf));
+ if (fcreated) {
+ PRIV_START
+ unlink(atfile);
+ PRIV_END
+ }
+ _exit(EXIT_FAILURE);
}
/* Local functions */