Use err(3). Cosmetic in usage string.

This commit is contained in:
Philippe Charnier 1997-07-24 06:58:08 +00:00
parent 0e11b68bdd
commit 950622c987
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27644
3 changed files with 27 additions and 33 deletions

View File

@ -34,18 +34,20 @@
* 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: main.c,v 1.16 1997/02/22 19:27:14 peter Exp $
*/
#ifndef lint
static char copyright[] =
static const char copyright[] =
"@(#) Copyright (c) 1988, 1989, 1990, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */
/*-
@ -85,6 +87,7 @@ static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#include <sys/utsname.h>
#endif
#include <sys/wait.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@ -249,9 +252,7 @@ rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
debug |= DEBUG_VAR;
break;
default:
(void)fprintf(stderr,
"make: illegal argument to d option -- %c\n",
*modules);
warnx("illegal argument to d option -- %c", *modules);
usage();
}
Var_Append(MAKEFLAGS, "-d", VAR_GLOBAL);
@ -387,8 +388,7 @@ chdir_verify_path(path, obpath)
if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
if (chdir(path)) {
(void)fprintf(stderr, "make warning: %s: %s.\n",
path, strerror(errno));
warn("warning: %s", path);
return 0;
}
else {
@ -460,16 +460,11 @@ main(argc, argv)
* on a different machine with pmake.
*/
curdir = cdpath;
if (getcwd(curdir, MAXPATHLEN) == NULL) {
(void)fprintf(stderr, "make: %s.\n", strerror(errno));
exit(2);
}
if (getcwd(curdir, MAXPATHLEN) == NULL)
err(2, NULL);
if (stat(curdir, &sa) == -1) {
(void)fprintf(stderr, "make: %s: %s.\n",
curdir, strerror(errno));
exit(2);
}
if (stat(curdir, &sa) == -1)
err(2, "%s", curdir);
if ((pwd = getenv("PWD")) != NULL) {
if (stat(pwd, &sb) == 0 && sa.st_ino == sb.st_ino &&
@ -1206,8 +1201,7 @@ erealloc(ptr, size)
void
enomem()
{
(void)fprintf(stderr, "make: %s.\n", strerror(errno));
exit(2);
err(2, NULL);
}
/*
@ -1237,10 +1231,10 @@ eunlink(file)
static void
usage()
{
(void)fprintf(stderr,
"usage: make [-Beiknqrst] [-D variable] [-d flags] [-f makefile ]\n\
[-I directory] [-j max_jobs] [-m directory] [-V variable]\n\
[variable=value] [target ...]\n");
(void)fprintf(stderr, "%s\n%s\n%s\n",
"usage: make [-Beiknqrst] [-D variable] [-d flags] [-f makefile ]",
" [-I directory] [-j max_jobs] [-m directory] [-V variable]",
" [variable=value] [target ...]");
exit(2);
}

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\" $Id$
.\" $Id: make.1,v 1.10 1997/03/09 15:50:58 wosch Exp $
.\"
.Dd March 19, 1994
.Dt MAKE 1
@ -117,7 +117,7 @@ Print debugging information about target list maintenance.
Print debugging information about variable assignment.
.El
.It Fl e
Specify that environmental variables override macro assignments within
Specify that environment variables override macro assignments within
makefiles.
.It Fl f Ar makefile
Specify a makefile to read instead of the default

View File

@ -34,12 +34,14 @@
* 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
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#endif
static const char rcsid[] =
"$Id$";
#endif /* not lint */
/*-
@ -89,9 +91,9 @@ static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
#include <varargs.h>
#endif
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <err.h>
#include <stdio.h>
#include "make.h"
#include "hash.h"
#include "dir.h"
@ -2522,10 +2524,8 @@ Parse_File(name, stream)
*/
Cond_End();
if (fatals) {
fprintf (stderr, "Fatal errors encountered -- cannot continue\n");
exit (1);
}
if (fatals)
errx(1, "fatal errors encountered -- cannot continue");
}
/*-