Gentoo Archives: gentoo-portage-dev

From: Alec Warner <antarus@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] econf: update configure/config.{sub,guess} atomically to avoid races
Date: Wed, 18 Dec 2013 05:17:00
Message-Id: CAAr7Pr-qvTRRV6d2Jhphb3J3hwZpFvsGWw48E=yQyF51kbnXpA@mail.gmail.com
In Reply to: Re: [gentoo-portage-dev] [PATCH] econf: update configure/config.{sub,guess} atomically to avoid races by Greg Turner
1 On Tue, Dec 17, 2013 at 6:53 PM, Greg Turner <gmt@×××××.us> wrote:
2
3 > On Tue, Dec 17, 2013 at 5:58 PM, Alec Warner <antarus@g.o> wrote:
4 > > Sed is already atomic
5 > >
6 > > antarus@goats5 /tmp/test $ cat foo
7 > > Debian Rocks!
8 > > antarus@goats5 /tmp/test $ strace -e trace=file sed -i -e
9 > > 's/Debian/Gentoo/g' foo
10 > [snip]
11 > > open("foo", O_RDONLY) = 3
12 > > open("/proc/filesystems", O_RDONLY) = 4
13 > > open("./sedfDxBxl", O_RDWR|O_CREAT|O_EXCL, 0600) = 4
14 > > rename("./sedfDxBxl", "foo") = 0
15 >
16 > Nice demonstration! Been wondering about that...
17 >
18
19 I originally opened the source code and tried to find the actual rename
20 code...but gave up after about 2 minutes figuring strace would be quicker.
21 I was right ;)
22
23 -A
24
25
26 >
27 > -gmt
28 >
29 >