patch-2.4.20 linux-2.4.20/arch/ppc64/boot/addRamDisk.c

Next file: linux-2.4.20/arch/ppc64/boot/addSystemMap.c
Previous file: linux-2.4.20/arch/ppc64/Makefile
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/arch/ppc64/boot/addRamDisk.c linux-2.4.20/arch/ppc64/boot/addRamDisk.c
@@ -25,7 +25,7 @@
 
 void death(const char *msg, FILE *fdesc, const char *fname) 
 {
-	printf(msg);
+	fprintf(stderr, msg);
 	fclose(fdesc);
 	unlink(fname);
 	exit(1);
@@ -66,47 +66,47 @@
   
   
 	if (argc < 2) {
-		printf("Name of RAM disk file missing.\n");
+		fprintf(stderr, "Name of RAM disk file missing.\n");
 		exit(1);
 	}
 
 	if (argc < 3) {
-		printf("Name of System Map input file is missing.\n");
+		fprintf(stderr, "Name of System Map input file is missing.\n");
 		exit(1);
 	}
   
 	if (argc < 4) {
-		printf("Name of vmlinux file missing.\n");
+		fprintf(stderr, "Name of vmlinux file missing.\n");
 		exit(1);
 	}
 
 	if (argc < 5) {
-		printf("Name of vmlinux output file missing.\n");
+		fprintf(stderr, "Name of vmlinux output file missing.\n");
 		exit(1);
 	}
 
 
 	ramDisk = fopen(argv[1], "r");
 	if ( ! ramDisk ) {
-		printf("RAM disk file \"%s\" failed to open.\n", argv[1]);
+		fprintf(stderr, "RAM disk file \"%s\" failed to open.\n", argv[1]);
 		exit(1);
 	}
 
 	sysmap = fopen(argv[2], "r");
 	if ( ! sysmap ) {
-		printf("System Map file \"%s\" failed to open.\n", argv[2]);
+		fprintf(stderr, "System Map file \"%s\" failed to open.\n", argv[2]);
 		exit(1);
 	}
   
 	inputVmlinux = fopen(argv[3], "r");
 	if ( ! inputVmlinux ) {
-		printf("vmlinux file \"%s\" failed to open.\n", argv[3]);
+		fprintf(stderr, "vmlinux file \"%s\" failed to open.\n", argv[3]);
 		exit(1);
 	}
   
 	outputVmlinux = fopen(argv[4], "w+");
 	if ( ! outputVmlinux ) {
-		printf("output vmlinux file \"%s\" failed to open.\n", argv[4]);
+		fprintf(stderr, "output vmlinux file \"%s\" failed to open.\n", argv[4]);
 		exit(1);
 	}
   
@@ -118,7 +118,7 @@
 	fseek(inputVmlinux, 0, SEEK_SET);
 	printf("kernel file size = %d\n", kernelLen);
 	if ( kernelLen == 0 ) {
-		printf("You must have a linux kernel specified as argv[3]\n");
+		fprintf(stderr, "You must have a linux kernel specified as argv[3]\n");
 		exit(1);
 	}
 
@@ -160,9 +160,9 @@
 	/* search for _end in the last page of the system map */
 	ptr_end = strstr(inbuf, " _end");
 	if (!ptr_end) {
-		printf("Unable to find _end in the sysmap file \n");
-		printf("inbuf: \n");
-		printf("%s \n", inbuf);
+		fprintf(stderr, "Unable to find _end in the sysmap file \n");
+		fprintf(stderr, "inbuf: \n");
+		fprintf(stderr, "%s \n", inbuf);
 		exit(1);
 	}
 	printf("Found _end in the last page of the sysmap - backing up 10 characters it looks like %s", ptr_end-10);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)