From priitp@213-219-88-89-dsl.lsn.estpak.ee  Wed Jun  4 14:54:38 2003
Return-Path: <priitp@213-219-88-89-dsl.lsn.estpak.ee>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3413437B404
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Jun 2003 14:54:38 -0700 (PDT)
Received: from 213-219-88-89-dsl.lsn.estpak.ee (213-219-88-89-dsl.lsn.estpak.ee [213.219.88.89])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 0C51B43FAF
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  4 Jun 2003 14:54:30 -0700 (PDT)
	(envelope-from priitp@213-219-88-89-dsl.lsn.estpak.ee)
Received: from 213-219-88-89-dsl.lsn.estpak.ee (localhost.meskaliin [127.0.0.1])
	by 213-219-88-89-dsl.lsn.estpak.ee (8.12.9/8.12.6) with ESMTP id h550XGTq033367
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 5 Jun 2003 00:33:20 GMT
	(envelope-from priitp@213-219-88-89-dsl.lsn.estpak.ee)
Received: (from priitp@localhost)
	by 213-219-88-89-dsl.lsn.estpak.ee (8.12.9/8.12.6/Submit) id h550XBeD033366;
	Thu, 5 Jun 2003 00:33:11 GMT
Message-Id: <200306050033.h550XBeD033366@213-219-88-89-dsl.lsn.estpak.ee>
Date: Thu, 5 Jun 2003 00:33:11 GMT
From: Priit Piipuu <priit.piipuu@mail.ee>
Reply-To: Priit Piipuu <priit.piipuu@mail.ee>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Unbreak the share/examples/kld/cdev
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52954
>Category:       misc
>Synopsis:       [PATCH] Unbreak the share/examples/kld/cdev
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    mbr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 04 15:00:28 PDT 2003
>Closed-Date:    Sun Aug 03 03:39:44 PDT 2003
>Last-Modified:  Sun Aug 03 03:39:44 PDT 2003
>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:
Responsible-Changed-From-To: freebsd-bugs->mbr 
Responsible-Changed-By: mbr 
Responsible-Changed-When: Thu Jun 5 14:08:22 PDT 2003 
Responsible-Changed-Why:  
Take this PR. I'll inform then the opensound people 
that they can rebuild their modules, since it was this 
file they were complaining about that it was broken. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52954 
State-Changed-From-To: open->closed 
State-Changed-By: mbr 
State-Changed-When: Sun Aug 3 03:38:27 PDT 2003 
State-Changed-Why:  
Committed, thanks ! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52954 
>Unformatted:
