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 * 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 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*
* $Id$
*/ */
#ifndef lint #ifndef lint
@ -61,6 +63,7 @@ static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93";
#include <ttyent.h> #include <ttyent.h>
#include <unistd.h> #include <unistd.h>
#include <sys/reboot.h> #include <sys/reboot.h>
#include <err.h>
#ifdef __STDC__ #ifdef __STDC__
#include <stdarg.h> #include <stdarg.h>
@ -195,16 +198,12 @@ main(argc, argv)
/* Dispose of random users. */ /* Dispose of random users. */
if (getuid() != 0) { if (getuid() != 0)
(void)fprintf(stderr, "init: %s\n", strerror(EPERM)); errx(1, "%s", strerror(EPERM));
exit (1);
}
/* System V users like to reexec init. */ /* System V users like to reexec init. */
if (getpid() != 1) { if (getpid() != 1)
(void)fprintf(stderr, "init: already running\n"); errx(1, "already running");
exit (1);
}
/* /*
* Note that this does NOT open a file... * Note that this does NOT open a file...