make(1): remove "Results: none" from the documentation of void functionsdiff -r1.189 -r1.190 src/usr.bin/make/dir.c
(rillig)
--- src/usr.bin/make/dir.c 2020/10/25 21:51:48 1.189
+++ src/usr.bin/make/dir.c 2020/10/26 23:28:52 1.190
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: dir.c,v 1.189 2020/10/25 21:51:48 rillig Exp $ */ | 1 | /* $NetBSD: dir.c,v 1.190 2020/10/26 23:28:52 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | 4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Adam de Boor. | 8 | * Adam de Boor. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -125,27 +125,27 @@ | @@ -125,27 +125,27 @@ | |||
125 | */ | 125 | */ | |
126 | 126 | |||
127 | #include <sys/types.h> | 127 | #include <sys/types.h> | |
128 | #include <sys/stat.h> | 128 | #include <sys/stat.h> | |
129 | 129 | |||
130 | #include <dirent.h> | 130 | #include <dirent.h> | |
131 | #include <errno.h> | 131 | #include <errno.h> | |
132 | 132 | |||
133 | #include "make.h" | 133 | #include "make.h" | |
134 | #include "dir.h" | 134 | #include "dir.h" | |
135 | #include "job.h" | 135 | #include "job.h" | |
136 | 136 | |||
137 | /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ | 137 | /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ | |
138 | MAKE_RCSID("$NetBSD: dir.c,v 1.189 2020/10/25 21:51:48 rillig Exp $"); | 138 | MAKE_RCSID("$NetBSD: dir.c,v 1.190 2020/10/26 23:28:52 rillig Exp $"); | |
139 | 139 | |||
140 | #define DIR_DEBUG0(text) DEBUG0(DIR, text) | 140 | #define DIR_DEBUG0(text) DEBUG0(DIR, text) | |
141 | #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) | 141 | #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) | |
142 | #define DIR_DEBUG2(fmt, arg1, arg2) DEBUG2(DIR, fmt, arg1, arg2) | 142 | #define DIR_DEBUG2(fmt, arg1, arg2) DEBUG2(DIR, fmt, arg1, arg2) | |
143 | 143 | |||
144 | /* | 144 | /* | |
145 | * A search path consists of a list of CachedDir structures. A CachedDir | 145 | * A search path consists of a list of CachedDir structures. A CachedDir | |
146 | * has in it the name of the directory and a hash table of all the files | 146 | * has in it the name of the directory and a hash table of all the files | |
147 | * in the directory. This is used to cut down on the number of system | 147 | * in the directory. This is used to cut down on the number of system | |
148 | * calls necessary to find implicit dependents and their like. Since | 148 | * calls necessary to find implicit dependents and their like. Since | |
149 | * these searches are made before any actions are taken, we need not | 149 | * these searches are made before any actions are taken, we need not | |
150 | * worry about the directory changing due to creation commands. If this | 150 | * worry about the directory changing due to creation commands. If this | |
151 | * hampers the style of some makefiles, they must be changed. | 151 | * hampers the style of some makefiles, they must be changed. | |
@@ -1493,114 +1493,71 @@ Dir_MakeFlags(const char *flag, SearchPa | @@ -1493,114 +1493,71 @@ Dir_MakeFlags(const char *flag, SearchPa | |||
1493 | 1493 | |||
1494 | if (path != NULL) { | 1494 | if (path != NULL) { | |
1495 | for (ln = path->first; ln != NULL; ln = ln->next) { | 1495 | for (ln = path->first; ln != NULL; ln = ln->next) { | |
1496 | CachedDir *dir = ln->datum; | 1496 | CachedDir *dir = ln->datum; | |
1497 | Buf_AddStr(&buf, " "); | 1497 | Buf_AddStr(&buf, " "); | |
1498 | Buf_AddStr(&buf, flag); | 1498 | Buf_AddStr(&buf, flag); | |
1499 | Buf_AddStr(&buf, dir->name); | 1499 | Buf_AddStr(&buf, dir->name); | |
1500 | } | 1500 | } | |
1501 | } | 1501 | } | |
1502 | 1502 | |||
1503 | return Buf_Destroy(&buf, FALSE); | 1503 | return Buf_Destroy(&buf, FALSE); | |
1504 | } | 1504 | } | |
1505 | 1505 | |||
1506 | /*- | 1506 | /* Nuke a directory descriptor, if possible. Callback procedure for the | |
1507 | *----------------------------------------------------------------------- | 1507 | * suffixes module when destroying a search path. | |
1508 | * Dir_Destroy -- | |||
1509 | * Nuke a directory descriptor, if possible. Callback procedure | |||
1510 | * for the suffixes module when destroying a search path. | |||
1511 | * | 1508 | * | |
1512 | * Input: | 1509 | * Input: | |
1513 | * dirp The directory descriptor to nuke | 1510 | * dirp The directory descriptor to nuke | |
1514 | * | |||
1515 | * Results: | |||
1516 | * None. | |||
1517 | * | |||
1518 | * Side Effects: | |||
1519 | * If no other path references this directory (refCount == 0), | |||
1520 | * the CachedDir and all its data are freed. | |||
1521 | * | |||
1522 | *----------------------------------------------------------------------- | |||
1523 | */ | 1511 | */ | |
1524 | void | 1512 | void | |
1525 | Dir_Destroy(void *dirp) | 1513 | Dir_Destroy(void *dirp) | |
1526 | { | 1514 | { | |
1527 | CachedDir *dir = dirp; | 1515 | CachedDir *dir = dirp; | |
1528 | dir->refCount--; | 1516 | dir->refCount--; | |
1529 | 1517 | |||
1530 | if (dir->refCount == 0) { | 1518 | if (dir->refCount == 0) { | |
1531 | OpenDirs_Remove(&openDirs, dir->name); | 1519 | OpenDirs_Remove(&openDirs, dir->name); | |
1532 | 1520 | |||
1533 | HashTable_Done(&dir->files); | 1521 | HashTable_Done(&dir->files); | |
1534 | free(dir->name); | 1522 | free(dir->name); | |
1535 | free(dir); | 1523 | free(dir); | |
1536 | } | 1524 | } | |
1537 | } | 1525 | } | |
1538 | 1526 | |||
1539 | /*- | 1527 | /* Clear out all elements from the given search path. | |
1540 | *----------------------------------------------------------------------- | 1528 | * The path is set to the empty list but is not destroyed. */ | |
1541 | * Dir_ClearPath -- | |||
1542 | * Clear out all elements of the given search path. This is different | |||
1543 | * from destroying the list, notice. | |||
1544 | * | |||
1545 | * Input: | |||
1546 | * path Path to clear | |||
1547 | * | |||
1548 | * Results: | |||
1549 | * None. | |||
1550 | * | |||
1551 | * Side Effects: | |||
1552 | * The path is set to the empty list. | |||
1553 | * | |||
1554 | *----------------------------------------------------------------------- | |||
1555 | */ | |||
1556 | void | 1529 | void | |
1557 | Dir_ClearPath(SearchPath *path) | 1530 | Dir_ClearPath(SearchPath *path) | |
1558 | { | 1531 | { | |
1559 | while (!Lst_IsEmpty(path)) { | 1532 | while (!Lst_IsEmpty(path)) { | |
1560 | CachedDir *dir = Lst_Dequeue(path); | 1533 | CachedDir *dir = Lst_Dequeue(path); | |
1561 | Dir_Destroy(dir); | 1534 | Dir_Destroy(dir); | |
1562 | } | 1535 | } | |
1563 | } | 1536 | } | |
1564 | 1537 | |||
1565 | 1538 | |||
1566 | /*- | 1539 | /* Concatenate two paths, adding the second to the end of the first, | |
1567 | *----------------------------------------------------------------------- | 1540 | * skipping duplicates. */ | |
1568 | * Dir_Concat -- | |||
1569 | * Concatenate two paths, adding the second to the end of the first. | |||
1570 | * Makes sure to avoid duplicates. | |||
1571 | * | |||
1572 | * Input: | |||
1573 | * path1 Dest | |||
1574 | * path2 Source | |||
1575 | * | |||
1576 | * Results: | |||
1577 | * None | |||
1578 | * | |||
1579 | * Side Effects: | |||
1580 | * Reference counts for added dirs are upped. | |||
1581 | * | |||
1582 | *----------------------------------------------------------------------- | |||
1583 | */ | |||
1584 | void | 1541 | void | |
1585 | Dir_Concat(SearchPath *path1, SearchPath *path2) | 1542 | Dir_Concat(SearchPath *dst, SearchPath *src) | |
1586 | { | 1543 | { | |
1587 | SearchPathNode *ln; | 1544 | SearchPathNode *ln; | |
1588 | 1545 | |||
1589 | for (ln = path2->first; ln != NULL; ln = ln->next) { | 1546 | for (ln = src->first; ln != NULL; ln = ln->next) { | |
1590 | CachedDir *dir = ln->datum; | 1547 | CachedDir *dir = ln->datum; | |
1591 | if (Lst_FindDatum(path1, dir) == NULL) { | 1548 | if (Lst_FindDatum(dst, dir) == NULL) { | |
1592 | dir->refCount++; | 1549 | dir->refCount++; | |
1593 | Lst_Append(path1, dir); | 1550 | Lst_Append(dst, dir); | |
1594 | } | 1551 | } | |
1595 | } | 1552 | } | |
1596 | } | 1553 | } | |
1597 | 1554 | |||
1598 | static int | 1555 | static int | |
1599 | percentage(int num, int den) | 1556 | percentage(int num, int den) | |
1600 | { | 1557 | { | |
1601 | return den != 0 ? num * 100 / den : 0; | 1558 | return den != 0 ? num * 100 / den : 0; | |
1602 | } | 1559 | } | |
1603 | 1560 | |||
1604 | /********** DEBUG INFO **********/ | 1561 | /********** DEBUG INFO **********/ | |
1605 | void | 1562 | void | |
1606 | Dir_PrintDirectories(void) | 1563 | Dir_PrintDirectories(void) |
--- src/usr.bin/make/job.c 2020/10/26 23:19:17 1.292
+++ src/usr.bin/make/job.c 2020/10/26 23:28:52 1.293
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: job.c,v 1.292 2020/10/26 23:19:17 rillig Exp $ */ | 1 | /* $NetBSD: job.c,v 1.293 2020/10/26 23:28:52 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | 4 | * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Adam de Boor. | 8 | * Adam de Boor. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -133,27 +133,27 @@ | @@ -133,27 +133,27 @@ | |||
133 | #ifndef USE_SELECT | 133 | #ifndef USE_SELECT | |
134 | #include <poll.h> | 134 | #include <poll.h> | |
135 | #endif | 135 | #endif | |
136 | #include <signal.h> | 136 | #include <signal.h> | |
137 | #include <utime.h> | 137 | #include <utime.h> | |
138 | 138 | |||
139 | #include "make.h" | 139 | #include "make.h" | |
140 | #include "dir.h" | 140 | #include "dir.h" | |
141 | #include "job.h" | 141 | #include "job.h" | |
142 | #include "pathnames.h" | 142 | #include "pathnames.h" | |
143 | #include "trace.h" | 143 | #include "trace.h" | |
144 | 144 | |||
145 | /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ | 145 | /* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ | |
146 | MAKE_RCSID("$NetBSD: job.c,v 1.292 2020/10/26 23:19:17 rillig Exp $"); | 146 | MAKE_RCSID("$NetBSD: job.c,v 1.293 2020/10/26 23:28:52 rillig Exp $"); | |
147 | 147 | |||
148 | /* A shell defines how the commands are run. All commands for a target are | 148 | /* A shell defines how the commands are run. All commands for a target are | |
149 | * written into a single file, which is then given to the shell to execute | 149 | * written into a single file, which is then given to the shell to execute | |
150 | * the commands from it. The commands are written to the file using a few | 150 | * the commands from it. The commands are written to the file using a few | |
151 | * templates for echo control and error control. | 151 | * templates for echo control and error control. | |
152 | * | 152 | * | |
153 | * The name of the shell is the basename for the predefined shells, such as | 153 | * The name of the shell is the basename for the predefined shells, such as | |
154 | * "sh", "csh", "bash". For custom shells, it is the full pathname, and its | 154 | * "sh", "csh", "bash". For custom shells, it is the full pathname, and its | |
155 | * basename is used to select the type of shell; the longest match wins. | 155 | * basename is used to select the type of shell; the longest match wins. | |
156 | * So /usr/pkg/bin/bash has type sh, /usr/local/bin/tcsh has type csh. | 156 | * So /usr/pkg/bin/bash has type sh, /usr/local/bin/tcsh has type csh. | |
157 | * | 157 | * | |
158 | * The echoing of command lines is controlled using hasEchoCtl, echoOff, | 158 | * The echoing of command lines is controlled using hasEchoCtl, echoOff, | |
159 | * echoOn, noPrint and noPrintLen. When echoOff is executed by the shell, it | 159 | * echoOn, noPrint and noPrintLen. When echoOff is executed by the shell, it | |
@@ -1711,29 +1711,26 @@ JobOutput(Job *job, char *cp, char *endp | @@ -1711,29 +1711,26 @@ JobOutput(Job *job, char *cp, char *endp | |||
1711 | * output channel until the file is empty. At which point we | 1711 | * output channel until the file is empty. At which point we | |
1712 | * remove the temporary file. | 1712 | * remove the temporary file. | |
1713 | * In both cases, however, we keep our figurative eye out for the | 1713 | * In both cases, however, we keep our figurative eye out for the | |
1714 | * 'noPrint' line for the shell from which the output came. If | 1714 | * 'noPrint' line for the shell from which the output came. If | |
1715 | * we recognize a line, we don't print it. If the command is not | 1715 | * we recognize a line, we don't print it. If the command is not | |
1716 | * alone on the line (the character after it is not \0 or \n), we | 1716 | * alone on the line (the character after it is not \0 or \n), we | |
1717 | * do print whatever follows it. | 1717 | * do print whatever follows it. | |
1718 | * | 1718 | * | |
1719 | * Input: | 1719 | * Input: | |
1720 | * job the job whose output needs printing | 1720 | * job the job whose output needs printing | |
1721 | * finish TRUE if this is the last time we'll be called | 1721 | * finish TRUE if this is the last time we'll be called | |
1722 | * for this job | 1722 | * for this job | |
1723 | * | 1723 | * | |
1724 | * Results: | |||
1725 | * None | |||
1726 | * | |||
1727 | * Side Effects: | 1724 | * Side Effects: | |
1728 | * curPos may be shifted as may the contents of outBuf. | 1725 | * curPos may be shifted as may the contents of outBuf. | |
1729 | *----------------------------------------------------------------------- | 1726 | *----------------------------------------------------------------------- | |
1730 | */ | 1727 | */ | |
1731 | static void | 1728 | static void | |
1732 | JobDoOutput(Job *job, Boolean finish) | 1729 | JobDoOutput(Job *job, Boolean finish) | |
1733 | { | 1730 | { | |
1734 | Boolean gotNL = FALSE; /* true if got a newline */ | 1731 | Boolean gotNL = FALSE; /* true if got a newline */ | |
1735 | Boolean fbuf; /* true if our buffer filled up */ | 1732 | Boolean fbuf; /* true if our buffer filled up */ | |
1736 | size_t nr; /* number of bytes read */ | 1733 | size_t nr; /* number of bytes read */ | |
1737 | size_t i; /* auxiliary index into outBuf */ | 1734 | size_t i; /* auxiliary index into outBuf */ | |
1738 | size_t max; /* limit for i (end of current data) */ | 1735 | size_t max; /* limit for i (end of current data) */ | |
1739 | ssize_t nRead; /* (Temporary) number of bytes read */ | 1736 | ssize_t nRead; /* (Temporary) number of bytes read */ |
--- src/usr.bin/make/main.c 2020/10/26 21:34:10 1.391
+++ src/usr.bin/make/main.c 2020/10/26 23:28:52 1.392
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: main.c,v 1.391 2020/10/26 21:34:10 rillig Exp $ */ | 1 | /* $NetBSD: main.c,v 1.392 2020/10/26 23:28:52 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1988, 1989, 1990, 1993 | 4 | * Copyright (c) 1988, 1989, 1990, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * Adam de Boor. | 8 | * Adam de Boor. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -108,27 +108,27 @@ | @@ -108,27 +108,27 @@ | |||
108 | 108 | |||
109 | #include <errno.h> | 109 | #include <errno.h> | |
110 | #include <signal.h> | 110 | #include <signal.h> | |
111 | #include <stdarg.h> | 111 | #include <stdarg.h> | |
112 | #include <time.h> | 112 | #include <time.h> | |
113 | 113 | |||
114 | #include "make.h" | 114 | #include "make.h" | |
115 | #include "dir.h" | 115 | #include "dir.h" | |
116 | #include "job.h" | 116 | #include "job.h" | |
117 | #include "pathnames.h" | 117 | #include "pathnames.h" | |
118 | #include "trace.h" | 118 | #include "trace.h" | |
119 | 119 | |||
120 | /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ | 120 | /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ | |
121 | MAKE_RCSID("$NetBSD: main.c,v 1.391 2020/10/26 21:34:10 rillig Exp $"); | 121 | MAKE_RCSID("$NetBSD: main.c,v 1.392 2020/10/26 23:28:52 rillig Exp $"); | |
122 | #if defined(MAKE_NATIVE) && !defined(lint) | 122 | #if defined(MAKE_NATIVE) && !defined(lint) | |
123 | __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " | 123 | __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " | |
124 | "The Regents of the University of California. " | 124 | "The Regents of the University of California. " | |
125 | "All rights reserved."); | 125 | "All rights reserved."); | |
126 | #endif | 126 | #endif | |
127 | 127 | |||
128 | #ifndef DEFMAXLOCAL | 128 | #ifndef DEFMAXLOCAL | |
129 | #define DEFMAXLOCAL DEFMAXJOBS | 129 | #define DEFMAXLOCAL DEFMAXJOBS | |
130 | #endif | 130 | #endif | |
131 | 131 | |||
132 | CmdOpts opts; | 132 | CmdOpts opts; | |
133 | time_t now; /* Time at start of make */ | 133 | time_t now; /* Time at start of make */ | |
134 | GNode *DEFAULT; /* .DEFAULT node */ | 134 | GNode *DEFAULT; /* .DEFAULT node */ | |
@@ -1773,90 +1773,63 @@ Fatal(const char *fmt, ...) | @@ -1773,90 +1773,63 @@ Fatal(const char *fmt, ...) | |||
1773 | (void)vfprintf(stderr, fmt, ap); | 1773 | (void)vfprintf(stderr, fmt, ap); | |
1774 | va_end(ap); | 1774 | va_end(ap); | |
1775 | (void)fprintf(stderr, "\n"); | 1775 | (void)fprintf(stderr, "\n"); | |
1776 | (void)fflush(stderr); | 1776 | (void)fflush(stderr); | |
1777 | 1777 | |||
1778 | PrintOnError(NULL, NULL); | 1778 | PrintOnError(NULL, NULL); | |
1779 | 1779 | |||
1780 | if (DEBUG(GRAPH2) || DEBUG(GRAPH3)) | 1780 | if (DEBUG(GRAPH2) || DEBUG(GRAPH3)) | |
1781 | Targ_PrintGraph(2); | 1781 | Targ_PrintGraph(2); | |
1782 | Trace_Log(MAKEERROR, 0); | 1782 | Trace_Log(MAKEERROR, 0); | |
1783 | exit(2); /* Not 1 so -q can distinguish error */ | 1783 | exit(2); /* Not 1 so -q can distinguish error */ | |
1784 | } | 1784 | } | |
1785 | 1785 | |||
1786 | /* | 1786 | /* Major exception once jobs are being created. | |
1787 | * Punt -- | 1787 | * Kills all jobs, prints a message and exits. */ | |
1788 | * Major exception once jobs are being created. Kills all jobs, prints | |||
1789 | * a message and exits. | |||
1790 | * | |||
1791 | * Results: | |||
1792 | * None | |||
1793 | * | |||
1794 | * Side Effects: | |||
1795 | * All children are killed indiscriminately and the program Lib_Exits | |||
1796 | */ | |||
1797 | void | 1788 | void | |
1798 | Punt(const char *fmt, ...) | 1789 | Punt(const char *fmt, ...) | |
1799 | { | 1790 | { | |
1800 | va_list ap; | 1791 | va_list ap; | |
1801 | 1792 | |||
1802 | va_start(ap, fmt); | 1793 | va_start(ap, fmt); | |
1803 | (void)fflush(stdout); | 1794 | (void)fflush(stdout); | |
1804 | (void)fprintf(stderr, "%s: ", progname); | 1795 | (void)fprintf(stderr, "%s: ", progname); | |
1805 | (void)vfprintf(stderr, fmt, ap); | 1796 | (void)vfprintf(stderr, fmt, ap); | |
1806 | va_end(ap); | 1797 | va_end(ap); | |
1807 | (void)fprintf(stderr, "\n"); | 1798 | (void)fprintf(stderr, "\n"); | |
1808 | (void)fflush(stderr); | 1799 | (void)fflush(stderr); | |
1809 | 1800 | |||
1810 | PrintOnError(NULL, NULL); | 1801 | PrintOnError(NULL, NULL); | |
1811 | 1802 | |||
1812 | DieHorribly(); | 1803 | DieHorribly(); | |
1813 | } | 1804 | } | |
1814 | 1805 | |||
1815 | /*- | 1806 | /* Exit without giving a message. */ | |
1816 | * DieHorribly -- | |||
1817 | * Exit without giving a message. | |||
1818 | * | |||
1819 | * Results: | |||
1820 | * None | |||
1821 | * | |||
1822 | * Side Effects: | |||
1823 | * A big one... | |||
1824 | */ | |||
1825 | void | 1807 | void | |
1826 | DieHorribly(void) | 1808 | DieHorribly(void) | |
1827 | { | 1809 | { | |
1828 | if (jobsRunning) | 1810 | if (jobsRunning) | |
1829 | Job_AbortAll(); | 1811 | Job_AbortAll(); | |
1830 | if (DEBUG(GRAPH2)) | 1812 | if (DEBUG(GRAPH2)) | |
1831 | Targ_PrintGraph(2); | 1813 | Targ_PrintGraph(2); | |
1832 | Trace_Log(MAKEERROR, 0); | 1814 | Trace_Log(MAKEERROR, 0); | |
1833 | exit(2); /* Not 1, so -q can distinguish error */ | 1815 | exit(2); /* Not 1, so -q can distinguish error */ | |
1834 | } | 1816 | } | |
1835 | 1817 | |||
1836 | /* | 1818 | /* Called when aborting due to errors in child shell to signal abnormal exit. | |
1837 | * Finish -- | 1819 | * The program exits. | |
1838 | * Called when aborting due to errors in child shell to signal | 1820 | * Errors is the number of errors encountered in Make_Make. */ | |
1839 | * abnormal exit. | |||
1840 | * | |||
1841 | * Results: | |||
1842 | * None | |||
1843 | * | |||
1844 | * Side Effects: | |||
1845 | * The program exits | |||
1846 | */ | |||
1847 | void | 1821 | void | |
1848 | Finish(int errors) | 1822 | Finish(int errors) | |
1849 | /* number of errors encountered in Make_Make */ | |||
1850 | { | 1823 | { | |
1851 | if (dieQuietly(NULL, -1)) | 1824 | if (dieQuietly(NULL, -1)) | |
1852 | exit(2); | 1825 | exit(2); | |
1853 | Fatal("%d error%s", errors, errors == 1 ? "" : "s"); | 1826 | Fatal("%d error%s", errors, errors == 1 ? "" : "s"); | |
1854 | } | 1827 | } | |
1855 | 1828 | |||
1856 | /* | 1829 | /* | |
1857 | * eunlink -- | 1830 | * eunlink -- | |
1858 | * Remove a file carefully, avoiding directories. | 1831 | * Remove a file carefully, avoiding directories. | |
1859 | */ | 1832 | */ | |
1860 | int | 1833 | int | |
1861 | eunlink(const char *file) | 1834 | eunlink(const char *file) | |
1862 | { | 1835 | { |