summaryrefslogtreecommitdiffstats
path: root/emulators/rtc/files/rtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/rtc/files/rtc.c')
-rw-r--r--emulators/rtc/files/rtc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/emulators/rtc/files/rtc.c b/emulators/rtc/files/rtc.c
index c9063ad..6b604ef 100644
--- a/emulators/rtc/files/rtc.c
+++ b/emulators/rtc/files/rtc.c
@@ -266,11 +266,12 @@ rtc_poll(dev_t dev, int events, struct proc *p)
}
/* -=-=-=-=-=-=-=-=-= module load/unload stuff -=-=-=-=-=-=-=-=-= */
+static dev_t rtc_dev = NULL;
+
static int
init_module(void)
{
int error = 0;
- dev_t dev;
#if __FreeBSD_version < 500104
error = cdevsw_add(&rtc_cdevsw);
@@ -278,8 +279,8 @@ init_module(void)
return error;
#endif
- dev = make_dev(&rtc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, DEVICE_NAME);
- if (dev==NULL)
+ rtc_dev = make_dev(&rtc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, DEVICE_NAME);
+ if (rtc_dev==NULL)
error = ENOMEM;
return error;
@@ -298,6 +299,7 @@ cleanup_module(void)
DLog(Lfail, "%p busy", sc);
return error;
}
+ destroy_dev(rtc_dev);
#if __FreeBSD_version < 500104
error = cdevsw_remove(&rtc_cdevsw);
#endif
OpenPOWER on IntegriCloud