From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0E217198005 for ; Sat, 23 Mar 2013 19:02:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EF28CE0740; Sat, 23 Mar 2013 19:02:31 +0000 (UTC) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E56B7E0638 for ; Sat, 23 Mar 2013 19:02:29 +0000 (UTC) Received: by mail-vc0-f172.google.com with SMTP id hr11so3905845vcb.17 for ; Sat, 23 Mar 2013 12:02:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:x-originating-ip:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding:x-gm-message-state; bh=pThuY8T2VJPNItWU8eb9ytJMh9EtMYZ975rqFY0JQ1M=; b=N32xsqBLqYE+mNWDt5dvNXixv/8I7H3NyJ7iE0iQVv3G0XXyDCtzyjpgooiBuhObSG tBDIP9mLeQZTp6TwKWNEVQgyZCSqZuShGUZxjLgMMUzFsm/Wuac46hivkpKvRbv91N/3 MYhGhWHTRo+OKyZVMgd8/Q0deyTnHohO6Tt1Gr8JCMWmqKpFT2nCo2mIn4YMI1q6gmXh l7LNGRKh6QEg2OuBHIES0BcNvNENeBKjIeVimjhuqlF2oSWluy4zFd2GA8VrMzWbMobZ jUKcuUaXdRYbP+J6lJweAQWv74kkjnLeuU6lTwGokbLFHyLO0QHiXb8gq5D3L5KB0QGG kzUA== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.52.33.68 with SMTP id p4mr6848795vdi.125.1364065349100; Sat, 23 Mar 2013 12:02:29 -0700 (PDT) Sender: antarus@scriptkitty.com Received: by 10.220.164.202 with HTTP; Sat, 23 Mar 2013 12:02:29 -0700 (PDT) X-Originating-IP: [75.147.136.182] In-Reply-To: <514DFB16.9060701@gentoo.org> References: <20130323172532.1b1100e2@pomiocik.lan> <1364055998-23674-1-git-send-email-mgorny@gentoo.org> <514DFB16.9060701@gentoo.org> Date: Sat, 23 Mar 2013 12:02:29 -0700 X-Google-Sender-Auth: 8PTGzVnycnTdgRvGenRiDMonyJc Message-ID: Subject: [gentoo-dev] Re: [PATCH 1/2] Introduce multibuild_merge_root() to merge interim installs. From: Alec Warner To: Jonathan Callen Cc: gentoo-dev@lists.gentoo.org, =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmpDcdIBnMncqPVrlheU2GcON4A3w7yvHUFui1ON67/m5cz09G79IvxyAAKeulSw8JiTh/m X-Archives-Salt: 4cc466c9-197a-4b27-802d-150b0e39054d X-Archives-Hash: ba1ab82b3735c2a96d065b844b2e221c On Sat, Mar 23, 2013 at 11:57 AM, Jonathan Callen wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On 03/23/2013 01:44 PM, Alec Warner wrote: >> On Sat, Mar 23, 2013 at 9:26 AM, Micha=C5=82 G=C3=B3rny >> wrote: >>> + # Close the lock file when we are done >>> with it. + # Prevents deadlock if we aren't >>> in a subshell. + eval "exec ${lock_fd}>&-" >> >> Not following this bit. >> >> The bash manpage says N>&DIGIT- redirects fd DIGIT to fd N. N may >> be unspecified and defaults to 1. >> >> It doesn't say what happens if DIGIT is unspecified. Nor does it >> say it closes any file descriptors. >> > > The relevant section of bash(1) is reproduced below: > > Duplicating File Descriptors > The redirection operator > > [n]<&word > > is used to duplicate input file descriptors. If word expands to > one or more digits, the file descriptor denoted by n is made to > be a copy of that file descriptor. If the digits in word do not > specify a file descriptor open for input, a redirection error > occurs. If word evaluates to -, file descriptor n is closed. > If n is not specified, the standard input (file descriptor 0) is > used. > > The operator > > [n]>&word > > is used similarly to duplicate output file descriptors. If n is > not specified, the standard output (file descriptor 1) is used. > If the digits in word do not specify a file descriptor open for > output, a redirection error occurs. As a special case, if n is > omitted, and word does not expand to one or more digits, the > standard output and standard error are redirected as described > previously. > > While the outcome of n>&- is not specified directly in the man page, > it is treated exactly as n<&- is. Ahh, I was reading: Moving File Descriptors The redirection operator [n]<&digit- moves the file descriptor digit to file descriptor n, or the standard input (file descriptor 0) if n is not specified. digit is closed after being duplicated to n. Similarly, the redirection operator [n]>&digit- moves the file descriptor digit to file descriptor n, or the standard output (file descriptor 1) if n is not specified. I see where i went wrong now ;) > > - -- > Jonathan Callen > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.19 (GNU/Linux) > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iQIcBAEBCgAGBQJRTfsWAAoJELHSF2kinlg4MO0P+wTQovWzYdfSgUP8H4WFmO1y > fpERqd1ZIoPle5Gl5+IUOWIHoMqkjS3mIAYUKF9cYwkufHRjbIs9l6NFGZg4wbRj > baCW6dRTbnbaM/YSiHLlstb4I5fcSwldwhtJrMuO9O6qLq2IFupJYkaSLnYJMs6C > HspU9W+bw4Vuvlk2wnhjGDGUj06ZIifQEOE6NYUVqF4GQaZlZpCsgA5BADPQL8zL > RAb90dJuRIuPPwgzuFka1+h0z4Sg5xxSlV7FS4c+r+HzrZCHHIHSyi9lOpOPB/8M > P+ZzJyDD3weW5AnAIuDjhJ3Rt0wI/2oYRRoVmC6hZ1CNSZuSjUCdWi6jvIvg99cR > TscJ0dKBl7bMcrrIILcXYgHtyKC/QRZWp6r0JxqOwX4L7FbPhF3qbtano+TxoCSr > X7hfCuRab1FEPE+jXeprH0c+N31SHrVBxfkJDG39MVx8hdJqXYzKCXah5/6lMJ63 > Td2lc7Y3UBuXpxvQBoBCWTEV3vmKBrNX6v5Bu9TTLmrhfkcMsjCMX6TdU54tUoEU > YE37njpI4Thsl24/LPQtzkR8v9fVyYqVvvXylSq5HcM48VlqlhcI/EP0SRo9eUXu > CFRkwb7u5nX4YOdUMj+L0P59/N7Zobdfs/dCvGB4PDeJTqzFJowxVhm7Dh1Uxf6l > a1CBWFm9+S7kUPDTfwV6 > =3DtFvf > -----END PGP SIGNATURE-----