summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Yanfei <zhangyanfei@cn.fujitsu.com>2013-03-27 22:00:59 +0800
committerSimon Horman <horms@verge.net.au>2013-03-27 23:05:45 +0900
commit42e97b2ee545901070e6bb9bb8b9a80a5ea01e2e (patch)
treee0fa1db5fcbe1e507490ea20d99f8eba95804b2b
parent827491661670e3d7f8edf08cce2ed0f423d710eb (diff)
kexec: Use die() to simplify code
Use die() to simplify code. Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/ppc/fixup_dtb.c4
-rw-r--r--kexec/arch/ppc/kexec-elf-ppc.c3
-rw-r--r--kexec/arch/ppc/kexec-uImage-ppc.c3
-rw-r--r--kexec/arch/sh/kexec-sh.c3
4 files changed, 4 insertions, 9 deletions
diff --git a/kexec/arch/ppc/fixup_dtb.c b/kexec/arch/ppc/fixup_dtb.c
index f832026..b10ac59 100644
--- a/kexec/arch/ppc/fixup_dtb.c
+++ b/kexec/arch/ppc/fixup_dtb.c
@@ -58,9 +58,7 @@ static void fixup_nodes(char *nodes[])
content = slurp_file(fname, &content_size);
if (!content) {
- fprintf(stderr, "Can't open %s: %s\n",
- fname, strerror(errno));
- exit(1);
+ die("Can't open %s: %s\n", fname, strerror(errno));
}
prop_name = fname + len;
diff --git a/kexec/arch/ppc/kexec-elf-ppc.c b/kexec/arch/ppc/kexec-elf-ppc.c
index 694befb..3daca2d 100644
--- a/kexec/arch/ppc/kexec-elf-ppc.c
+++ b/kexec/arch/ppc/kexec-elf-ppc.c
@@ -227,8 +227,7 @@ int elf_ppc_load(int argc, char **argv, const char *buf, off_t len,
case OPT_NODES:
if (cur_fixup >= FIXUP_ENTRYS) {
- fprintf(stderr, "The number of entries for the fixup is too large\n");
- exit(1);
+ die("The number of entries for the fixup is too large\n");
}
fixup_nodes[cur_fixup] = optarg;
cur_fixup++;
diff --git a/kexec/arch/ppc/kexec-uImage-ppc.c b/kexec/arch/ppc/kexec-uImage-ppc.c
index c4d39f2..9113fbe 100644
--- a/kexec/arch/ppc/kexec-uImage-ppc.c
+++ b/kexec/arch/ppc/kexec-uImage-ppc.c
@@ -130,8 +130,7 @@ static int ppc_load_bare_bits(int argc, char **argv, const char *buf,
case OPT_NODES:
if (cur_fixup >= FIXUP_ENTRYS) {
- fprintf(stderr, "The number of entries for the fixup is too large\n");
- exit(1);
+ die("The number of entries for the fixup is too large\n");
}
fixup_nodes[cur_fixup] = optarg;
cur_fixup++;
diff --git a/kexec/arch/sh/kexec-sh.c b/kexec/arch/sh/kexec-sh.c
index 7710fdf..ea56041 100644
--- a/kexec/arch/sh/kexec-sh.c
+++ b/kexec/arch/sh/kexec-sh.c
@@ -159,8 +159,7 @@ char *get_append(void)
FILE *fp;
int len;
if((fp = fopen("/proc/cmdline", "r")) == NULL){
- printf("/proc/cmdline file open error !!\n");
- exit(1);
+ die("/proc/cmdline file open error !!\n");
}
fgets(append_buf, 256, fp);
len = strlen(append_buf);