aboutsummaryrefslogtreecommitdiff
path: root/sbin/init/init.c
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1997-06-13 06:24:42 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1997-06-13 06:24:42 +0000
commitc5842835452d2941164eba9279a147e20e54dcd4 (patch)
tree349ae47709642648c092104d15c986f84a4d222f /sbin/init/init.c
parent27e24fdf13897aa15553499eb9ed4840b42fcf41 (diff)
downloadsrc-c5842835452d2941164eba9279a147e20e54dcd4.tar.gz
src-c5842835452d2941164eba9279a147e20e54dcd4.zip
Use err(3).
Notes
Notes: svn path=/head/; revision=26594
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 e0ffcf8ea577..ed2da13252f9 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...