summaryrefslogtreecommitdiffstats
path: root/sbin/init/init.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-06-13 06:24:42 +0000
committercharnier <charnier@FreeBSD.org>1997-06-13 06:24:42 +0000
commit98daca0d1cd42947f8fbda8d4e40d875c3bbdc55 (patch)
tree1e0f11628c21b453b1dc61d4901b25055a1e9486 /sbin/init/init.c
parentb481633bcfbfdf54a2d5876f86d1b0b5231a3022 (diff)
downloadFreeBSD-src-98daca0d1cd42947f8fbda8d4e40d875c3bbdc55.zip
FreeBSD-src-98daca0d1cd42947f8fbda8d4e40d875c3bbdc55.tar.gz
Use err(3).
Diffstat (limited to 'sbin/init/init.c')
-rw-r--r--sbin/init/init.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index e0ffcf8..ed2da13 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -32,6 +32,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $Id$
*/
#ifndef lint
@@ -61,6 +63,7 @@ static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93";
#include <ttyent.h>
#include <unistd.h>
#include <sys/reboot.h>
+#include <err.h>
#ifdef __STDC__
#include <stdarg.h>
@@ -195,16 +198,12 @@ main(argc, argv)
/* Dispose of random users. */
- if (getuid() != 0) {
- (void)fprintf(stderr, "init: %s\n", strerror(EPERM));
- exit (1);
- }
+ if (getuid() != 0)
+ errx(1, "%s", strerror(EPERM));
/* System V users like to reexec init. */
- if (getpid() != 1) {
- (void)fprintf(stderr, "init: already running\n");
- exit (1);
- }
+ if (getpid() != 1)
+ errx(1, "already running");
/*
* Note that this does NOT open a file...
OpenPOWER on IntegriCloud