shithub: gefs

Download patch

ref: f76ca1de77fb595a5592813bf52704ea670ce21a
parent: 50fa1c68904a3cf5c73745e2e6a48f13b1ed7bf7
author: Ori Bernstein <[email protected]>
date: Tue Dec 19 22:49:23 EST 2023

blk: work around vlong silliness on 386

--- a/blk.c
+++ b/blk.c
@@ -293,7 +293,8 @@
 	 * and chaining.
 	 */
 	if(lb == nil || lb->logsz >= Logspc - Logslop){
-		if((o = blkalloc_lk(a)) == -1)
+		o = blkalloc_lk(a);
+		if(o == -1)
 			error(Efull);
 		nl = mklogblk(a, o);
 		p = lb->data + lb->logsz;
@@ -434,7 +435,8 @@
 		return -1;
 	}
 	for(i = 0; i < nblks; i++){
-		if((blks[i] = blkalloc_lk(a)) == -1){
+		blks[i] = blkalloc_lk(a);
+		if(blks[i] == -1){
 			fprint(2, "out of space to compress log");
 			free(blks);
 			return -1;
@@ -574,7 +576,8 @@
 		qunlock(a);
 		nexterror();
 	}
-	if((b = blkalloc_lk(a)) == -1){
+	b = blkalloc_lk(a);
+	if(b == -1){
 		qunlock(a);
 		poperror();
 		goto Again;