[libvirt] [PATCH] rpcgen fixes

Jim Meyering jim at meyering.net
Wed Dec 17 15:42:47 UTC 2008

John Levon <john.levon at Sun.COM> wrote:
>> > +	perl -w @top_srcdir@/qemud/rpcgen_fix.pl rp.h-t \
>> > +	    >@top_srcdir@/qemud/remote_protocol.h
>> Please don't redirect directly to something used as a build source.
>> Instead, redirect to a temporary file, and rename that into place
>> upon successful completion.  That makes it less likely you'll ever
>> end up with corrupted sources.
> Sorry I'm missing why this helps any?

In rules where you're redirecting to $@, it's essential
so that you don't end up with a corrupt-yet-up-to-date target.

Here, it'd be nice.
Otherwise, if the command fails with a disk full or I/O
error, you're left with an incomplete file, and you might
have missed the failure and/or you might then forget to rerun it,
which leaves you to figure out why things don't work.
Not a terribly big deal in this case; since it's version-controlled,
you'll probably notice the diffs pretty quickly.

Oh, also, since you've added the new "rpcgen" target,
please declare it phony to GNU make with this:

.PHONY: rpcgen

otherwise, if you run make -t (or otherwise create a file
name rpcgen), that rule will do nothing.

More information about the libvir-list mailing list