summaryrefslogtreecommitdiffstats
path: root/usr.bin/at/panic.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1999-12-05 19:57:14 +0000
committercharnier <charnier@FreeBSD.org>1999-12-05 19:57:14 +0000
commit345f916537662d077177ceb1c7c10258d69143c0 (patch)
tree688e50df63e8fd20ecde66d5157337b9c8e1e0b6 /usr.bin/at/panic.c
parent8b03354e3023710aa24c33cc8203969bc0d9de54 (diff)
downloadFreeBSD-src-345f916537662d077177ceb1c7c10258d69143c0.zip
FreeBSD-src-345f916537662d077177ceb1c7c10258d69143c0.tar.gz
Correct use of .Nm, .Em, .Ev
Add rcsid. Use errx instead of fprintf + exit. Various spelling fixes.
Diffstat (limited to 'usr.bin/at/panic.c')
-rw-r--r--usr.bin/at/panic.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/usr.bin/at/panic.c b/usr.bin/at/panic.c
index 6098c95..9cabc1d 100644
--- a/usr.bin/at/panic.c
+++ b/usr.bin/at/panic.c
@@ -23,8 +23,14 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef lint
+static const char rcsid[] =
+ "$FreeBSD$";
+#endif /* not lint */
+
/* System Headers */
+#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -35,11 +41,6 @@
#include "panic.h"
#include "at.h"
-/* File scope variables */
-
-static const char rcsid[] =
- "$FreeBSD$";
-
/* External variables */
/* Global functions */
@@ -49,11 +50,10 @@ panic(char *a)
{
/* Something fatal has happened, print error message and exit.
*/
- fprintf(stderr,"%s: %s\n",namep,a);
if (fcreated)
unlink(atfile);
- exit (EXIT_FAILURE);
+ errx(EXIT_FAILURE, "%s", a);
}
void
@@ -61,11 +61,13 @@ perr(char *a)
{
/* Some operating system error; print error message and exit.
*/
- perror(a);
+ int serrno = errno;
+
if (fcreated)
unlink(atfile);
- exit(EXIT_FAILURE);
+ errno = serrno;
+ err(EXIT_FAILURE, "%s", a);
}
void
OpenPOWER on IntegriCloud