[libvirt] [PATCH 10/17] remove duplicate inclusion of "remote_protocol.h" (before <config.h>!)

Jim Meyering jim at meyering.net
Tue Oct 28 12:50:20 UTC 2008


Jim Meyering <jim at meyering.net> wrote:

> "Daniel P. Berrange" <berrange at redhat.com> wrote:
>
>> On Tue, Oct 28, 2008 at 12:21:27PM +0100, Jim Meyering wrote:
>>> From: Jim Meyering <meyering at redhat.com>
>>>
>>> ---
>>>  qemud/remote_protocol.c |    1 -
>>>  1 files changed, 0 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/qemud/remote_protocol.c b/qemud/remote_protocol.c
>>> index 5ef80e5..06b33d8 100644
>>> --- a/qemud/remote_protocol.c
>>> +++ b/qemud/remote_protocol.c
>>> @@ -3,7 +3,6 @@
>>>   * It was generated using rpcgen.
>>>   */
>>>
>>> -#include "remote_protocol.h"
>>>  #include <config.h>
>>>  #include "internal.h"
>>>  #include "socketcompat.h"
>>
>> You're removing it in this patch, but then adding it back in the same
>> place in a later patch ?  Or rather, this is added automatically by
>> rpcgen when you generate this file...
>
> Nominally, one must not include *anything* before <config.h>,
> but since this doesn't cause trouble on systems I tested, I won't
> worry about it, for now.
>
> Besides, I shouldn't be modifying manually a generated file.
> I'll tweak the build rule to mark the file as read-only,
> so that I don't do that again.

This makes it less likely that I will accidentally modify one
of these two generated files:

>From 39fbaef130e7027956194824fb6379d95a60bfbd Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Tue, 28 Oct 2008 13:46:06 +0100
Subject: [PATCH] make generated qemud/*.[ch] files read-only

* qemud/Makefile.am (.x.c): Rewrite not to write directly to $@,
and to make generated files read-only.
(.x.h): Likewise.
---
 qemud/Makefile.am |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/qemud/Makefile.am b/qemud/Makefile.am
index 56275f6..dd4c128 100644
--- a/qemud/Makefile.am
+++ b/qemud/Makefile.am
@@ -34,18 +34,21 @@ EXTRA_DIST =						\
 if RPCGEN
 SUFFIXES = .x
 .x.c:
-	rm -f $@
-	rpcgen -c -o $@ $<
+	rm -f $@ $@-t $@-t2
+	rpcgen -c -o $@-t $<
 if GLIBC_RPCGEN
-	mv $@ $@.bak
-	perl -w rpcgen_fix.pl < $@.bak > $@
+	perl -w rpcgen_fix.pl $@-t > $@-t2
+	chmod 444 $@-t2
+	mv $@-t2 $@
 endif

 .x.h:
-	rm -f $@
-	rpcgen -h -o $@ $<
+	rm -f $@ $@-t
+	rpcgen -h -o $@-t $<
 if GLIBC_RPCGEN
-	perl -i -p -e 's/\t/        /g' $@
+	perl -pi -e 's/\t/        /g' $@-t
+	chmod 444 $@-t
+	mv $@-t $@
 endif
 endif

--
1.6.0.3.756.gb776d




More information about the libvir-list mailing list