misc/126435: [patch] /usr/share/examples/drivers/make_pseudo_driver.sh fails to compile.

Ed Schouten ed at 80386.nl
Mon Aug 11 08:55:10 UTC 2008


Hello Remko :-)

* Remko Lodder <remko at FreeBSD.org> wrote:
> Ed, I believe that this could have b een related to your devminor work,
> can you have a look at this? (Even if I am incorrect in the devminor
> part? ;-))

I have to say I don't really like this script. The code it creates isn't
fabulous, but that's no reason to leave it broken. There are two
problems with the script:

- SYSINIT() now requires a semicolon, which was introduced somewhere in
  June if I remember correctly (not by me).
- The problem isn't really that `unit' is unitialized. The actual
  problem is `scp', which must not be initialized.

The following patch fixed it for me. Now it's yours. ;-)

%%%
--- share/examples/drivers/make_pseudo_driver.sh
+++ share/examples/drivers/make_pseudo_driver.sh
@@ -344,7 +344,7 @@
 ${1}_drvinit(void *unused)
 {
 	int	unit;
-	sc_p scp  = sca[unit];
+	sc_p	scp;
 
 	for (unit = 0; unit < N${UPPER}; unit++) {
 		/*
@@ -362,7 +362,7 @@
 }
 
 SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR,
-		${1}_drvinit, NULL)
+		${1}_drvinit, NULL);
 DONE
 
 cat >${TOP}/sys/${1}io.h <<DONE
%%%

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-bugs/attachments/20080811/1f4d38bd/attachment.pgp


More information about the freebsd-bugs mailing list