Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Dec 2007 19:49:24 +0200
From:      Diomidis Spinellis <dds@aueb.gr>
To:        Alexander Kabaev <kabaev@gmail.com>
Cc:        cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, Diomidis Spinellis <dds@FreeBSD.ORG>, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/bin/mv mv.c
Message-ID:  <47656524.4010509@aueb.gr>
In-Reply-To: <20071216113543.2c16de3e@kan.dnsalias.net>
References:  <200712161414.lBGEEV3O050572@repoman.freebsd.org> <20071216113543.2c16de3e@kan.dnsalias.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Alexander Kabaev wrote:
> On Sun, 16 Dec 2007 14:14:31 +0000 (UTC)
> Diomidis Spinellis <dds@FreeBSD.org> wrote:
> 
>> dds         2007-12-16 14:14:31 UTC
>>
>>   FreeBSD src repository
>>
>>   Modified files:
>>     bin/mv               mv.c 
>>   Log:
>>   When moving a directory across devices to a place where a directory
>>   with the same name exists, delete that directory first, before
>> performing the copy.  This ensures that mv(1) across devices follows
>> the semantics of rename(2), as required by POSIX.
>>   
>>   This change could introduce the potential of data loss, even if the
>>   copy fails, violating the atomicity properties of rename(2).  This
>> is (mostly) mitigated by first renaming the destination and
>> obliterating it only after a succesfull copy.
>>   
>>   The above logic also led to the introduction of code that will
>> cleanup the results of a partial copy, if a cross-device copy fails.
>>   
>>   PR:             bin/118367
>>   MFC after:      1 month
>>   
>>   Revision  Changes    Path
>>   1.47      +83 -23    src/bin/mv/mv.c
>>
>> http://cvsweb.FreeBSD.org/src/bin/mv/mv.c.diff?r1=1.46&r2=1.47
> 
> This breaks make buildworld on amd64 at least:
> 
> 
> /usr/src/bin/mv/mv.c: In function 'copy': /usr/src/bin/mv/mv.c:361:
> warning: variable 'rval' might be clobbered by 'longjmp' or 'vfork'
> /usr/src/bin/mv/mv.c:361: warning:variable 'i' might be clobbered by
> 'longjmp' or 'vfork'
> 

Thanks - sorry - I fixed it in 1.48.

-- 
Diomidis Spinellis



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47656524.4010509>