Commit Graph

242482 Commits

Author SHA1 Message Date
kre
4a9319b47c PR bin/48875 - minor correction (well, not so minor) - commands in loops
must be assumed to have something following, even if the loop itself doesn't,
so redirected fd's around func calls need to be saved.   Should fix etcupdate
2016-05-10 15:14:30 +00:00
pooka
ae809f65ce sprinkle _KERNEL_OPT 2016-05-10 15:14:03 +00:00
skrll
0f41c69003 Fixup ucom_cleanup to not forget our pipe handles.
Simplify ucomreadcb by dealing with the USBD_CANCELLED separately and
not taking sc_lock.  We can't hold sc_lock while aborting now.
2016-05-10 10:40:33 +00:00
martin
f5d70023d1 We need the -O1 hack (for gcc 5.3) for crtbegin.c as well.
Works around PR toolchain/51121.
2016-05-10 10:23:09 +00:00
mrg
a3ddb94352 update the micron smart codes for 247/248 to match data i found in
micron's "TN-FD-33: M510DC SSD SMART Implementation Introduction"
document.

these two values can be used to calculate the write amplication
factor:

   WAF = ( A247 + A248 ) / A247
2016-05-10 08:08:59 +00:00
sjg
83317c9428 Apply realpath() to p before matching against metaIgnorePaths. 2016-05-10 00:02:31 +00:00
kre
07e424459c PR bin/48875 PR bin/51123 This adds tests more that verify fide descriptor
redirection works correctly (including that the bugs reported in those PRs
are fixed.)  Note that the tests for 48875 are slow, so one of the new
test cases ends up running > 25 seconds (just doing sleeps) - each individual
test is just a few seconds, but there are several of them.

OK christos@
2016-05-09 22:34:37 +00:00
skrll
45619026b1 Don't forget to use HTOO32 when adding OHCI_TD_R to td_flags for short
reads.

Should fix problems with BE machines and ohci as reported on
current-users by Michael
2016-05-09 21:52:43 +00:00
christos
a2d6b270ec s/protected/libedit_private/g 2016-05-09 21:46:56 +00:00
christos
137ae6aea4 Instead of compiling all the source files together in one big file, use
protected visibility to achieve the same effect.
2016-05-09 21:38:27 +00:00
christos
ecb8efd172 Elide gcc warning about intermediate const casts caused by visibility change. 2016-05-09 21:37:34 +00:00
christos
f9ed317e87 GNU readline(3) regards history chronologically, that is, from the
perspective of the dawn of time, so "next" means "newer" and "previous"
means "older".  Libedit, by contrast, uses reverse chronology and
regards history from the perspective of the present, such that "next"
means "longer ago" and "previous" means "not so long ago".

The following patch fixes previous_history() and next_history()
as proposed by Bastian Maerkisch.

But there is a related problem demonstrated by Bastian's regression
tests that his patch did not fix:  next_history() can advance not
only to the newest entry, but beyond it, which core libedit cannot
do.  So that feature must be implemented locally in readline.c.

With that, the last of Bastians tests is fixed, test_movement_direction().

This patch also improves libedit documentation to more clearly state
what "previous" and "next" mean.  GNU readline documentation is
just as unclear, but we can't easily fix that since libedit doesn't
include its own readline.3 manual.

(Ingo Schwarze)
2016-05-09 21:27:55 +00:00
christos
05b61ce72a The libedit implementation of history_get() also differs from the GNU
implementation:  libedit goes to the entry with the given number
stored in the HistEvent structure, while GNU subtracts history_base,
then advances that many entries from the oldest one.  If entries were
removed in between, GNU advances further than libedit.

The call sequence H_CURR, H_DELDATA, H_CURR, H_NEXT_EVDATA looks
weird, as if part of that must somehow be redundant.  But actually,
the user interface is so counter-intuitive that every single step
is really required.

 - The first H_CURR is needed to be able to go back after an error.
 - The H_DELDATA is needed to move the cursor.  Even though it takes
   a pointer to ev, that structure is not filled in when the call
   succeeds.  H_DELDATA only moves the cursor, it doesn't tell us
   the new event number.
 - Consequently, the second H_CURR is required to get ev.num filled
   in.  But it doesn't return the data because ev has no field for
   that.
 - So even though the cursor is already positioned correctly,
   H_NEXT_EVDATA is needed as the final step merely to get the data.

(Ingo Schwarze)
2016-05-09 21:25:11 +00:00
kre
8a99e51de9 PR bin/48875 - avoid holding (replaced) file descriptors open when running a
command in the current shell (so they can be restored for the next command)
in cases where it is obvious that there is not going to be a following
command to use them.   This fixes the problem reported in the PR (though
there are still plenty of situations where a FD could be closed but isn't,
we do not do full fd flow eveluation to determine whether a fd will be
used or not).

This is the change that was just committed and then backed out again...

OK christos@
2016-05-09 21:03:10 +00:00
kre
baf83b5f55 Revert previous. These changes are intended to get made (and will
be in a minute or two) but not as part of that commit...   The log
entry certainly does not apply.
2016-05-09 20:55:51 +00:00
kre
07ee700a7e Finish the fd reassignment fixes from 1.43 and 1.45 ... if we are moving
a fd to an unspecified high fd number, we certainly do not want to hand
that high fd off to other processes after an exec, so always set close-on-exec
on the result (even if lack of fd's means no fd alteration happens.)
This will (eventually) allow some other code that sets close-on-exec to
be removed, but for now, doing it twice won't hurt.   Also, in a N>&M
type redirection, do not set close-on-exec if we don't want it.

OK christos@
2016-05-09 20:50:08 +00:00
kre
183536927f PR bin/48489 -- Shell "simple commands" are now not allowed to be
completely empty, they must have something (var assignment, redirect,
or command, or multiple of those) to avoid a syntax error.  This
matches the requirements of the grammar in the standard.   Correct the
parser (using FreeBSD's sh as a guide) and update the man page to
remove text that noted a couple of places this was previously OK.

OK christos@
2016-05-09 20:36:07 +00:00
martin
6f47729145 Avoid a "conversion to '__uint16_t' from 'int' may alter its value"
error on some architectures (like m68k).
2016-05-09 20:28:08 +00:00
skrll
f92670f913 Use the MI usb majors 2016-05-09 15:23:23 +00:00
christos
c7f0ba033b Account for the CRC len (Jean-Jacques.Puig) 2016-05-09 15:11:35 +00:00
christos
d7ac614b0a Don't increment the reference count only when it was 0...
From Jean-Jacques.Puig
2016-05-09 15:05:15 +00:00
roy
52185fadf0 Note import of dhcpcd-6.11.0 2016-05-09 10:21:42 +00:00
roy
ea7c879358 Define _OPENBSD_SOURCE so dhcpcd can access reallocarray(3). 2016-05-09 10:19:26 +00:00
roy
bc693cba55 Sync 2016-05-09 10:15:59 +00:00
ozaki-r
8e8364ddca Fix compilation for ppc 2016-05-09 07:02:10 +00:00
mlelstv
947d5ab451 kmem_alloc doesn't support allocating 0 bytes. 2016-05-09 04:55:34 +00:00
christos
c3337d4460 In stiffle_history(), trim excessive entries from the history and advance
history_base like the GNU implementation does. (from Bastian Maerkisch)
2016-05-08 20:15:00 +00:00
kre
ed8202014d PR bin/51123 - make >&- work in all cases, and while doing that fix
things so that >/dev/stdout </dev/stdin (etc) work as well (in all cases).

ok christos@
2016-05-08 20:14:27 +00:00
christos
2dddb15173 Fix stack allocation; limit delta to a quarter of the stack size. This should
get rid of the random aborts.
2016-05-08 20:01:56 +00:00
christos
f50af3d36b Enable DEBUG_EXEC, if we have DEBUG (since it only fires on errors) and
disable the super verbose printing by protecting it against TRACE_EXEC.
2016-05-08 20:00:21 +00:00
wiz
3e4f00a12d Remove unnecessary Ns macro. 2016-05-08 10:13:01 +00:00
wiz
4c689aa848 libarchive-3.2.0 is out. 2016-05-08 09:19:28 +00:00
maxv
f823c34f61 Define __rodata_start. Will be used soon. 2016-05-08 08:30:41 +00:00
maxv
900fb87538 Use killkpt for the PML4 entries as well. 2016-05-08 08:22:58 +00:00
skrll
267347083a More debug 2016-05-08 07:48:24 +00:00
skrll
856daf275d More options 2016-05-08 07:41:37 +00:00
skrll
ce9178132d Create sc_intr_lock at IPL_USB 2016-05-08 07:40:17 +00:00
kre
d4f114089f Whitespace fixes. No functional change. 2016-05-08 03:51:15 +00:00
christos
52e1f28ccd Catch up with other networking changes (John D. Baker) 2016-05-08 03:11:33 +00:00
christos
6b2e8a5337 Move all the randomization inside kern_pax.c so we can control it directly.
Add debugging flags to be able to set the random number externally.
2016-05-08 01:28:09 +00:00
kre
44b3998960 Remove the trap_zero__explicit_return test case - it was testing undefined
behaviour (and failed with the NetBSD shell, and was marked as expected to
fail.)   Other shells do different things.   The test was worthless, and is
now gone.

OK christos@
2016-05-07 23:51:30 +00:00
riastradh
6e111d367d Tweak comment on wapbl_flush. 2016-05-07 22:12:29 +00:00
riastradh
193947f42e Use %jx and a cast to uintmax_t, not %x, to print a dev_t. 2016-05-07 21:15:38 +00:00
riastradh
895c0fab4b Clarify comment about early exit from wapbl_flush.
Note possible bug.  Requires further analysis.
2016-05-07 21:11:51 +00:00
riastradh
2b3e02eb3e Omit unused parameter to wapbl_fini. 2016-05-07 20:59:46 +00:00
riastradh
c04b67eb10 Delete debugging option wapbl_lazy_truncate. Simplify.
Likely nobody has used this in the past decade -- you would have to
enter ddb and write 1 to it in order to enable it anyway.

Patch prepared by coypu.
2016-05-07 20:39:33 +00:00
riastradh
5589cef4c7 Turn WAPBL_DEBUG panic or KASSERT into KASSERTMSG
From coypu.
2016-05-07 20:18:44 +00:00
riastradh
c4a5d0a629 Document log layout and internal subroutines of vfs_wapbl.c. 2016-05-07 20:16:38 +00:00
kre
09ecfab926 Slightly improve "jobs" command output in cases where a job includes
embedded background commands or pipelines.   (just slightly...)
OK christos@
2016-05-07 20:07:47 +00:00
kre
3eee147437 PR bin/51119 - don't leak FDs in unusual error cases. OK christos@ 2016-05-07 20:06:30 +00:00