Commit Graph

281601 Commits

Author SHA1 Message Date
kamil
543accdbd7 Undo local patch having no impact
/tmp is picked from P_tmpdir earlier.
2020-10-06 21:49:22 +00:00
kamil
fef5fe3a2a Undo local NFC patch 2020-10-06 21:39:53 +00:00
rillig
80fb3ceeda make(1): add test for double expansion in SySV modifier 2020-10-06 21:19:17 +00:00
rillig
c4464b7b4b make(1): migrate SysV modifier test to use the preprocessor
When both the expected and the actual expression are written in the same
line of the same file, it is easier to compare them and to document
anything interesting.  The exp file doesn't provide any space for
comments or explanations.
2020-10-06 21:05:21 +00:00
mlelstv
3ce6ce8d42 Use raw device for configuring units. This is necessary as
having a block device opened prevents autodiscovery of wedges.
2020-10-06 18:47:07 +00:00
mlelstv
7686d3bd5e Fix ioctl locking. Add dkdriver. 2020-10-06 18:45:23 +00:00
rillig
78492823c2 make(1): remove macro FILENO
This macro was obviously wrong since it would have converted file
numbers above 127 to very large numbers, close to 2^32.

The fact that it didn't blow up at all is that this macro was only ever
given the file descriptor 4 as an argument, which can well be
represented as a char, be it signed or unsigned.  And this is how the
story goes:

In Job_Init, two jobs are started.  The server job allocates file
descriptors 15 and above.  The childExitJob is created next, and the
pipe that it creates is [3, 4].  Using F_DUPFD, fd 3 is mapped to fd 5,
and fd 3 is closed.  After that, fd 4 is mapped to fd 3 (which had just
been closed), and fd 4 is closed.

After this initialization, file descriptors 0, 1, 2, 3 and 5 are taken.
This leaves a gap at file descriptor 4, and this gap is filled whenever
cmdFILE is created.

Because of this particular order of events, the macro is not necessary.
If it should ever become necessary on platforms like the old SunOS, the
parameter minfd for JobCreatePipe should be increased to 5, which would
leave the file descriptors 3 and 4 to be used by stdio streams.

On 1995-11-03, when the macro was added, SunOS must have been in its
very early development.  In Solaris 8 (released in January 2000),
FILE._file is already an unsigned char, therefore the seeming need for
this macro must have been due to an older version, probably from the 2.x
series of SunOS.
2020-10-06 16:39:23 +00:00
mlelstv
e6735382cd Check dkdriver before calling a driver function. 2020-10-06 15:05:54 +00:00
christos
f5da3b7f1a GC unused MAXTSIZ32 2020-10-06 13:42:03 +00:00
christos
7c02b47ba1 make MAXTSIZ optional 2020-10-06 13:38:49 +00:00
christos
3910cb68f6 Make MAXTSIZ optional. 2020-10-06 13:38:00 +00:00
rin
95f08238e2 Revert the previous again; miniroot overflows this time...
- switch to x_disklabel (drop non-native label support)
- switch to x_fsck_ffs and x_newfs (drop byte-swapped and Apple UFS support)
- switch to more
2020-10-06 13:32:41 +00:00
rillig
05869a9f33 make(1): rework memory allocation for the name of variables
There's more to know about variable names than fits in a one-liner.
While here, enforce that the name is not modified by splitting it into
the established (var + var_freeIt) pattern.

Since the name is not modified and not freed in the middle of evaluating
an expression, there is no need to make a backup copy of it.  That code
had been necessary more than 12 years ago, but not anymore since the
code got a lot cleaner since then.
2020-10-06 08:13:27 +00:00
rillig
7687783e5b make(1): remove duplicate code for creating variables 2020-10-06 07:52:47 +00:00
skrll
f2860d4959 move #include "opt_compat_netbsd32.h" to where it's required 2020-10-06 06:26:46 +00:00
rillig
1b9c32a3c0 make(1): remove pathname limit for Dir_FindHereOrAbove
While trying to compile the code with GCC's -Wformat-truncation, the
snprintf calls felt quite complicated.  The function Dir_FindHereOrAbove
is not in a bottleneck execution path, therefore it doesn't hurt to
dynamically allocate the memory instead of using size-limited stack
memory.
2020-10-05 22:45:47 +00:00
rillig
ce82f0970c make(1): enable format string truncation warnings for parse.c
No node is ever going to have a million or more cohorts.  And even if
there were, this name is only used for printing informational messages.
2020-10-05 22:15:45 +00:00
rillig
883ec9be11 make(1): prepare job.c, main.c, parse.c, suff.c for WARNS=6
In job.c, GCC 5 complains about the macro FILENO that it has type
unsigned int, which is then passed as the argument of dup2, which
expects a simple int.  Maybe this workaround from 1995 is not necessary
anymore, or maybe it is but can be restricted to the few affected
platforms.

This leaves meta.c and the filemon files to be converted.  I didn't do
them since they are not well covered by the unit tests.
2020-10-05 21:37:07 +00:00
christos
c5aeb8a719 PR/55695: Andreas Gustafsson: factor(6) -h option doesn't always work
Handle -h for factors greater than the primes table.
2020-10-05 21:11:47 +00:00
rillig
a7157845f7 make(1): make dir.c, for.c and hash.c ready for WARNS=6
Some types have changed from int to unsigned int, size_t or time_t.

The variable i in hash.c has been kept as int since it counts down to
-1, which generates efficient machine code, at least on x86_64.
2020-10-05 20:21:30 +00:00
rillig
364e68a767 make(1): make cond.c ready for WARNS=6, part 2 2020-10-05 19:59:07 +00:00
rillig
b537e837b3 make(1): make cond.c ready for WARNS=6 2020-10-05 19:56:08 +00:00
rillig
04ade6cbee make(1): fix compilation with GCC 10 and -Wimplicit-fallthrough=4 2020-10-05 19:39:30 +00:00
rillig
c85833020f make(1): fix double-free bug in -DCLEANUP mode (since 2020-10-02)
The bug had been introduced with dir.c 1.155 on 2020-10-02 22:20:25.  In
that commit, openDirectories was replaced with a combination of a list
with a hash table, for more efficient lookup by name.

Upon cleanup, OpenDirs_Done is called, which in turn called
Dir_ClearPath.  Dir_ClearPath takes full ownership of the given list and
empties it.  This was no problem before since afterwards the list was
empty and calling Lst_Free just frees the remaining list pointer.

With OpenDirs, this list was combined with a hash table, and the hash
table contains the list nodes, assuming that the OpenDirs functions have
full ownership of both the list and the hash table.  This assumption was
generally correct, except for the one moment during cleanup where full
ownership of the list was passed to Dir_ClearPath, while the hash table
still contained pointers to the (now freed) list nodes.  This by itself
was not a problem since the hash table would be freed afterwards.  But
as part of Dir_ClearPath, OpenDirs_Remove was called, which looked up
the freed directory by name and now found the freed list node, trying to
free it again.  Boom.

Fixed by replacing the call to Dir_ClearPath with code that only frees
the directories, without giving up control over the list.
2020-10-05 19:30:37 +00:00
rillig
f336e55bc4 make(1): revert previous commit
It had accidentally reverted all the work from the past few days.
2020-10-05 19:27:47 +00:00
rillig
b6c0384ff9 make(1): fix double-free bug in -DCLEANUP mode (since 2020-10-02)
The bug had been introduced with dir.c 1.155 on 2020-10-02 22:20:25.  In
that commit, openDirectories was replaced with a combination of a list
with a hash table, for more efficient lookup by name.

Upon cleanup, OpenDirs_Done is called, which in turn called
Dir_ClearPath.  Dir_ClearPath takes full ownership of the given list and
empties it.  This was no problem before since afterwards the list was
empty and calling Lst_Free just frees the remaining list pointer.

With OpenDirs, this list was combined with a hash table, and the hash
table contains the list nodes, assuming that the OpenDirs functions have
full ownership of both the list and the hash table.  This assumption was
generally correct, except for the one moment during cleanup where full
ownership of the list was passed to Dir_ClearPath, while the hash table
still contained pointers to the (now freed) list nodes.  This by itself
was not a problem since the hash table would be freed afterwards.  But
as part of Dir_ClearPath, OpenDirs_Remove was called, which looked up
the freed directory by name and now found the freed list node, trying to
free it again.  Boom.

Fixed by replacing the call to Dir_ClearPath with code that only frees
the directories, without giving up control over the list.
2020-10-05 19:24:29 +00:00
rillig
1c039f5ce4 make(1): fix test for .ifndef when compiled with -DUSE_UCHAR_BOOLEAN
In that compilation variant, TRUE is defined to 255, to see whether all
boolean expressions evaluate to either 1 or 0.  The field If.doNot in
cond.c doesn't do this since it uses the actual value of TRUE.
Therefore, change the evaluation slightly to also handle this case.
2020-10-05 18:29:20 +00:00
rillig
d1e081ff69 make(1): clean up compat.c
Only cosmetic changes, no change of functionality.
2020-10-05 18:04:57 +00:00
rillig
37b6a2b531 make(1): extract init_machine and init_machine_arch from main 2020-10-05 17:33:21 +00:00
roy
ec2482217d Minor correction to prior 2020-10-05 17:29:22 +00:00
rillig
45096fccb8 make(1): extract parsing of sources from ParseDoDependency 2020-10-05 16:54:41 +00:00
rillig
6027965696 make(1): extract the target parsing from ParseDoDependency 2020-10-05 16:45:03 +00:00
rillig
31b39317c4 make(1): split ParseDoDependency into several smaller functions 2020-10-05 16:33:20 +00:00
roy
a6f0f00cfa ifconfig: Warn once more if media supported but no types
This reverts media.c -r1.7
2020-10-05 16:17:05 +00:00
roy
9fd3530377 ppp: Remove media
There is none after all.
Applications should be using ifi_link_state and not checking media.
2020-10-05 16:11:25 +00:00
roy
54ebee488b Note import of dhcpcd-9.3.0 2020-10-05 16:04:11 +00:00
roy
be38669a3c Sync with dhcpcd-9.3.0 2020-10-05 16:02:15 +00:00
roy
32fe301ab8 Update to dhcpcd-9.3.0 with the following changes:
* dhcpcd: Backticks have been removed from quoting filenames
 * dhcpcd: Only manipulate stdin, stdout and stderr if they are valid
 * duid: Adjust option so the type can be specified
 * logerr: Don't leak logfile fd to scripts
 * privsep: Run the launcher process in the sandbox
 * BSD: Use `ifi_link_state` as the single source of truth about carrier
 * BSD: Ignore vether(4) devices by default
2020-10-05 16:01:13 +00:00
rillig
f61ca2efc4 make(1): split ParseDoSrc into smaller functions 2020-10-05 15:43:32 +00:00
rillig
da5a66a335 make(1): replace GNode macros with inline functions
Curiously, this affects the size of the generated code: it gets smaller
than before.
2020-10-05 15:14:24 +00:00
rillig
41b60e14d8 make(1): allow easy creation of preprocessed source and assembler
To be used during development, to see how changes in the source code
affect the generated machine code.
2020-10-05 15:11:37 +00:00
nia
c50d584d1e NGPC 2020-10-05 14:54:50 +00:00
nia
baeda31567 bump date 2020-10-05 14:54:24 +00:00
christos
527b700deb revert previous octal conversion code (broken and not worth it). 2020-10-05 14:34:03 +00:00
christos
a17b1cd2d7 revert previous and don't parse octal 2020-10-05 14:31:30 +00:00
rin
098da78686 Update gdb/dwarf2expr.c hack for earmv7hf{,eb}; the situation does not
change even for GCC 9.3 with ``memcmp'' fix.
2020-10-05 13:32:31 +00:00
rin
d1007566db Update aes_ccm_tag() hack for m68k.
Even with ``memcmp fix'', GCC 9.4 miscompiles this function for -O[12].
But the situation was slightly changed from that with GCC 8.3:

* -O0 and -O1 work but -O2 fails for 68060 and 68040 (real hardware)
* -O0 and -O2 work but -O1 fails for 68020 and 68010 (TME)
2020-10-05 13:20:30 +00:00
martin
325b99962d Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.
2020-10-05 12:28:45 +00:00
tnn
7f481043e4 factor: usage(): mark __dead 2020-10-05 12:22:49 +00:00
simonb
05d9ab5269 Whitespace nit. 2020-10-05 11:29:36 +00:00