[tip:core/percpu] bzip2/lzma: don't leave empty files around on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  ab59d3b70f7a47987f80e153d828363faec643fe
Gitweb:     http://git.kernel.org/tip/ab59d3b70f7a47987f80e153d828363faec643fe
Author:     "Alain Knaff" <alain@xxxxxxxx>
AuthorDate: Thu, 19 Feb 2009 13:39:21 -0800
Commit:     H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
CommitDate: Thu, 19 Feb 2009 13:39:21 -0800

bzip2/lzma: don't leave empty files around on failure

Impact: Bugfix, silent build failures

Fix a bug in gen_initramfs_list.sh: in case of failure, it left an
empty output file behind, messing up the next make.

Signed-off-by: Alain Knaff <alain@xxxxxxxx>
Signed-off-by: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>


---
 scripts/gen_initramfs_list.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 41041e4..3eea8f1 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -292,7 +292,8 @@ if [ ! -z ${output_file} ]; then
 	if [ "${is_cpio_compressed}" = "compressed" ]; then
 		cat ${cpio_tfile} > ${output_file}
 	else
-		cat ${cpio_tfile} | ${compr}  - > ${output_file}
+		(cat ${cpio_tfile} | ${compr}  - > ${output_file}) \
+		|| (rm -f ${output_file} ; false)
 	fi
 	[ -z ${cpio_file} ] && rm ${cpio_tfile}
 fi
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux