Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jun 2003 00:33:11 GMT
From:      Priit Piipuu <priit.piipuu@mail.ee>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   misc/52954: [PATCH] Unbreak the share/examples/kld/cdev
Message-ID:  <200306050033.h550XBeD033366@213-219-88-89-dsl.lsn.estpak.ee>
Resent-Message-ID: <200306042200.h54M0Si6043006@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         52954
>Category:       misc
>Synopsis:       [PATCH] Unbreak the share/examples/kld/cdev
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 04 15:00:28 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Priit Piipuu
>Release:        FreeBSD 5.1-BETA i386
>Organization:
>Environment:
System: FreeBSD minerva 5.1-BETA FreeBSD 5.1-BETA #24: Wed May 21 00:14:22 GMT 2003 root@minerva:/usr/obj/usr/src/sys/tuum i386


>Description:
	Currently, cdevmod.c produces lots of warnings when compiled, 
	and cdev.ko panics the system when loaded. Seems, that struct
	cdevsw has changed since the last commit to this file.
>How-To-Repeat:
	cd share/examples/kld/cdev && make all
>Fix:

--- patch begins here ---
--- module/cdevmod.c.orig	Mon Oct  2 14:14:06 2000
+++ module/cdevmod.c	Thu Jun  5 00:14:18 2003
@@ -78,20 +78,18 @@
 #define CDEV_MAJOR 32
 
 static struct cdevsw my_devsw = {
-	/* open */	mydev_open,
-	/* close */	mydev_close,
-	/* read */	mydev_read,
-	/* write */	mydev_write,
-	/* ioctl */	mydev_ioctl,
-	/* poll */	nopoll,
-	/* mmap */	nommap,
-	/* strategy */	nostrategy,
-	/* name */	"cdev",
-	/* maj */	CDEV_MAJOR,
-	/* dump */	nodump,
-	/* psize */	nopsize,
-	/* flags */	D_TTY,
-	/* bmaj */	-1
+	/* open */	.d_open = mydev_open,
+	/* close */	.d_close = mydev_close,
+	/* read */	.d_read = mydev_read,
+	/* write */	.d_write = mydev_write,
+	/* ioctl */	.d_ioctl = mydev_ioctl,
+	/* poll */	.d_poll = nopoll,
+	/* mmap */	.d_mmap = nommap,
+	/* strategy */	.d_strategy = nostrategy,
+	/* name */	.d_name = "cdev",
+	/* maj */	.d_maj = CDEV_MAJOR,
+	/* dump */	.d_dump = nodump,
+	/* flags */	.d_flags = D_TTY,
 };
 
 /* 
--- test/testcdev.c.orig	Sat Dec  9 09:35:39 2000
+++ test/testcdev.c	Thu Jun  5 00:14:18 2003
@@ -75,6 +75,7 @@
 #include <fcntl.h>
 #include <paths.h>
 #include <string.h>
+#include <sys/types.h>
 #include <sys/ioccom.h>
 
 #define CDEV_IOCTL1     _IOR('C', 1, u_int)
--- patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306050033.h550XBeD033366>