changeset 74:fbea15a77235

Use exit()
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 16 Dec 2006 06:23:49 +0000
parents 8bad1e87b45d
children b391438cac33
files diffmap.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/diffmap.c	Sat Dec 16 06:18:24 2006 +0000
+++ b/diffmap.c	Sat Dec 16 06:23:49 2006 +0000
@@ -69,29 +69,30 @@
 		fprintf(stderr,
 		"Usage: %s mapfile1 mapfile2 > outfile\n",
 		argv[0]);
-		return 0;
+		exit(1);
 	}
 	
 	/* Read mapfiles */
 	if ((map1 = parseFile(argv[1])) == NULL) {
 		THERR("Could not parse input file #1: '%s'\n",
 			argv[1]);
-		return 1;
+		exit(2);
 	}
 
 	if ((map2 = parseFile(argv[2])) == NULL) {
 		THERR("Could not parse input file #2: '%s'\n",
 			argv[2]);
-		return 1;
+		exit(2);
 	}
 	
 	/* Compute and output data */
 	if ((res = diffBlocks(map1, map2)) == NULL) {
 		THERR("Could not create diff between inputs!\n");
-		return 1;
+		exit(3);
 	}
 	
 	printBlockRaw(stdout, res);
-
+	
+	exit(0);
 	return 0;
 }