panic.c (82973) | panic.c (87208) |
---|---|
1/* 2 * panic.c - terminate fast in case of error 3 * Copyright (C) 1993 Thomas Koenig 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#ifndef lint 27static const char rcsid[] = | 1/* 2 * panic.c - terminate fast in case of error 3 * Copyright (C) 1993 Thomas Koenig 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#ifndef lint 27static const char rcsid[] = |
28 "$FreeBSD: head/usr.bin/at/panic.c 82973 2001-09-04 16:15:51Z ru $"; | 28 "$FreeBSD: head/usr.bin/at/panic.c 87208 2001-12-02 12:26:18Z markm $"; |
29#endif /* not lint */ 30 31/* System Headers */ 32 33#include <err.h> 34#include <errno.h> 35#include <stdio.h> 36#include <stdlib.h> --- 5 unchanged lines hidden (view full) --- 42#include "privs.h" 43#include "at.h" 44 45/* External variables */ 46 47/* Global functions */ 48 49void | 29#endif /* not lint */ 30 31/* System Headers */ 32 33#include <err.h> 34#include <errno.h> 35#include <stdio.h> 36#include <stdlib.h> --- 5 unchanged lines hidden (view full) --- 42#include "privs.h" 43#include "at.h" 44 45/* External variables */ 46 47/* Global functions */ 48 49void |
50panic(char *a) | 50panic(const char *a) |
51{ 52/* Something fatal has happened, print error message and exit. 53 */ 54 if (fcreated) { 55 PRIV_START 56 unlink(atfile); 57 PRIV_END 58 } 59 60 errx(EXIT_FAILURE, "%s", a); 61} 62 63void | 51{ 52/* Something fatal has happened, print error message and exit. 53 */ 54 if (fcreated) { 55 PRIV_START 56 unlink(atfile); 57 PRIV_END 58 } 59 60 errx(EXIT_FAILURE, "%s", a); 61} 62 63void |
64perr(char *a) | 64perr(const char *a) |
65{ 66/* Some operating system error; print error message and exit. 67 */ 68 int serrno = errno; 69 70 if (fcreated) { 71 PRIV_START 72 unlink(atfile); --- 18 unchanged lines hidden --- | 65{ 66/* Some operating system error; print error message and exit. 67 */ 68 int serrno = errno; 69 70 if (fcreated) { 71 PRIV_START 72 unlink(atfile); --- 18 unchanged lines hidden --- |