Use err(3).

This commit is contained in:
Philippe Charnier 1997-06-13 06:24:42 +00:00
parent 27e24fdf13
commit c584283545
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26594

View File

@ -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...