From 9a5d6c23c5cc25b887f996d55f96dfbacf760e88 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 21 Sep 2011 18:46:56 +0200 Subject: tests/tools/examples: Replace direct exit() calls by return. --- tools/cws2fws.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tools') diff --git a/tools/cws2fws.c b/tools/cws2fws.c index b8535feaa4..35fce35683 100644 --- a/tools/cws2fws.c +++ b/tools/cws2fws.c @@ -29,14 +29,14 @@ int main(int argc, char *argv[]) if (argc < 3) { printf("Usage: %s \n", argv[0]); - exit(1); + return 1; } fd_in = open(argv[1], O_RDONLY); if (fd_in < 0) { perror("Error opening input file"); - exit(1); + return 1; } fd_out = open(argv[2], O_WRONLY|O_CREAT, 00644); @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) { perror("Error opening output file"); close(fd_in); - exit(1); + return 1; } if (read(fd_in, &buf_in, 8) != 8) @@ -52,13 +52,13 @@ int main(int argc, char *argv[]) printf("Header error\n"); close(fd_in); close(fd_out); - exit(1); + return 1; } if (buf_in[0] != 'C' || buf_in[1] != 'W' || buf_in[2] != 'S') { printf("Not a compressed flash file\n"); - exit(1); + return 1; } fstat(fd_in, &statbuf); @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) buf_in[0] = 'F'; if (write(fd_out, &buf_in, 8) < 8) { perror("Error writing output file"); - exit(1); + return 1; } zstream.zalloc = NULL; @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) { printf("Error while decompressing: %d\n", ret); inflateEnd(&zstream); - exit(1); + return 1; } dbgprintf("a_in: %d t_in: %lu a_out: %d t_out: %lu -- %lu out\n", @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) if (write(fd_out, &buf_out, zstream.total_out - last_out) < zstream.total_out - last_out) { perror("Error writing output file"); - exit(1); + return 1; } i += len; @@ -128,7 +128,7 @@ int main(int argc, char *argv[]) lseek(fd_out, 4, SEEK_SET); if (write(fd_out, &buf_in, 4) < 4) { perror("Error writing output file"); - exit(1); + return 1; } } -- cgit v1.2.3