misc/52954: [PATCH] Unbreak the share/examples/kld/cdev
Priit Piipuu
priit.piipuu at mail.ee
Wed Jun 4 15:00:30 PDT 2003
>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 at 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:
More information about the freebsd-bugs
mailing list