shithub: riscv

Download patch

ref: 87299152ec6af407392c9069107004c60953b696
parent: 36d797f8b638e97c753c9b32214bfefcdda9bc1b
author: cinap_lenrek <[email protected]>
date: Sun Apr 7 11:22:59 EDT 2024

pc, pc64: simplify error handling setscreensize()

The if(waserror()) nexterror(); is quite useless,
clean it up. do the bootscreenconf() at the very
end.

--- a/sys/src/9/pc/screen.c
+++ b/sys/src/9/pc/screen.c
@@ -130,9 +130,6 @@
 {
 	char *err;
 
-	if(waserror())
-		nexterror();
-
 	if(memimageinit() < 0)
 		error("memimageinit failed");
 
@@ -141,17 +138,13 @@
 		unlock(&vgascreenlock);
 		nexterror();
 	}
-
 	err = setscreensize0(scr, x, y, z, chan, tilt);
 	if(err != nil)
 		error(err);
-
 	vgaimageinit(chan);
 	unlock(&vgascreenlock);
 	poperror();
 
-	bootscreenconf(scr);
-
 	drawcmap();
 
 	if(scr->cur && scr->cur != &vgasoftcur){
@@ -160,7 +153,7 @@
 		cursoron();
 	}
 
-	poperror();
+	bootscreenconf(scr);
 }
 
 int