Skip to contentSkip to conversation

cr_tests: Use stdout for rewrite-cr-header.sh output

PATCH In review Matt Helsley 2 participants 2 messages Aug 5, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 cr_tests: Use stdout for rewrite-cr-header.sh output

Instead of overwriting cr.h in the current directory write the output of rewrite-cr-header.sh to stdout and let whoever invokes the script decide what to do with the output. This should make it slightly easier to test and make the script more widely usable (e.g. in user-cr).

Cc Linux Containers <containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
---
 rewrite-cr-header.sh |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
rewrite-cr-header.sh +0 -9
index ffc6f62..97f39fc 100755
@@ -40,9 +40,6 @@ fi
 
 ################################################################################
 
-mv cr.h cr.h.bak || exit -1
-
-(
 COND='#if'
 set -e
 echo '/* AUTOMATICALLY GENERATED by rewrite-cr-header.sh */'
@@ -88,9 +85,3 @@ while read UNISTDH ; do
 	COND='#elif'
 done
 echo -e '#else\n#error "Architecture does not have definitons for __NR_(checkpoint|restart)"\n#endif'
-) > cr.h || {
-	mv -f cr.h.bak cr.h
-	exit -1
-}
-
-rm -f cr.h.bak
Signature · 1 line
1.5.6.3

A message that is not in the archive (sent off-list or not yet received): 1249447347-26415-4-git-send-email-matthltc-r/[email protected]

#2 lore raw
Quoted 7 lines · Matt Helsley

Instead of overwriting cr.h in the current directory write the output of rewrite-cr-header.sh to stdout and let whoever invokes the script decide what to do with the output. This should make it slightly easier to test and make the script more widely usable (e.g. in user-cr).

Cc Linux Containers <containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>

All applied, thanks.

-serge

Quoted 30 lines
---
 rewrite-cr-header.sh |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)
rewrite-cr-header.sh +0 -9
index ffc6f62..97f39fc 100755
@@ -40,9 +40,6 @@ fi
 
 ################################################################################
 
-mv cr.h cr.h.bak || exit -1
-
-(
 COND='#if'
 set -e
 echo '/* AUTOMATICALLY GENERATED by rewrite-cr-header.sh */'
@@ -88,9 +85,3 @@ while read UNISTDH ; do
 	COND='#elif'
 done
 echo -e '#else\n#error "Architecture does not have definitons for __NR_(checkpoint|restart)"\n#endif'
-) > cr.h || {
-	mv -f cr.h.bak cr.h
-	exit -1
-}
-
-rm -f cr.h.bak
Signature · 1 line
1.5.6.3