summaryrefslogtreecommitdiff
path: root/sysutils/dd_rescue/files/patch-dd_rescue.c
blob: 72a1a20724cf422b3d8416eb65bb59413f703e6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- dd_rescue.c.orig	Sun Jul 23 20:47:50 2006
+++ dd_rescue.c	Mon Feb 12 02:53:35 2007
@@ -213,11 +213,13 @@
 
 void savebb( int block )
 {
+	FILE *bbfile;
+
 	fplog(stderr, "Bad block: %d\n", block);
     
 	if( bbname == NULL )
 		return;
-	FILE *bbfile = fopen(bbname,"a");
+	bbfile = fopen(bbname,"a");
 	fprintf(bbfile,"%d\n",block);
 	fclose(bbfile);
 }
@@ -742,7 +744,8 @@
 		ipos = 0;
 
 #ifdef O_DIRECT
-	if (posix_memalign(mp, sysconf(_SC_PAGESIZE), softbs)) {
+	buf = malloc(softbs);
+	if (!buf) {
 		fplog(stderr, "dd_rescue: (fatal): allocation of aligned buffer failed!\n");
 		cleanup(); exit(18);
 	}