summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-07-24 06:58:08 +0000
committercharnier <charnier@FreeBSD.org>1997-07-24 06:58:08 +0000
commitf61512bf13065db14f73912536dfcfa8fe665463 (patch)
treec33ab3753cc163231dd72087be5481abb0a61a45 /usr.bin/make
parent2df2878db2fff5ba7f8f8fe84159b8f955530617 (diff)
downloadFreeBSD-src-f61512bf13065db14f73912536dfcfa8fe665463.zip
FreeBSD-src-f61512bf13065db14f73912536dfcfa8fe665463.tar.gz
Use err(3). Cosmetic in usage string.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/main.c40
-rw-r--r--usr.bin/make/make.14
-rw-r--r--usr.bin/make/parse.c16
3 files changed, 27 insertions, 33 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 94851ad..dfe0c43 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -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);
}
diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1
index 8214e9a..1b997ab 100644
--- a/usr.bin/make/make.1
+++ b/usr.bin/make/make.1
@@ -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
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c
index 234364f..448aa96 100644
--- a/usr.bin/make/parse.c
+++ b/usr.bin/make/parse.c
@@ -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");
}
/*-
OpenPOWER on IntegriCloud