All of lore.kernel.org
 help / color / mirror / Atom feed
* bug with <&- under ulimit -n
@ 2010-10-27 21:33 Eric Blake
  2010-10-27 22:50 ` Jilles Tjoelker
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2010-10-27 21:33 UTC (permalink / raw)
  To: dash

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

Dash does not behave well when under artificial fd pressure due to
ulimit -n.  It insists on copying a to-be-closed fd to another fd
greater than 10, then complains when the dup fails, rather than just
flat-out closing the fd in the first place.  Compare this with ksh93

$ ksh -c 'ulimit -n 10; : <&-'; echo $?
0
$ dash -c 'ulimit -n 11; : <&-'; echo $?
0
$ dash -c 'ulimit -n 10; : <&-'; echo $?
dash: 0: Invalid argument
2

See this thread on the bug-tar list for more details:
http://thread.gmane.org/gmane.comp.gnu.tar.bugs/4010/focus=4020

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-28  2:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-27 21:33 bug with <&- under ulimit -n Eric Blake
2010-10-27 22:50 ` Jilles Tjoelker
2010-10-28  2:11   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.