Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175144781
D59621.id186534.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D59621.id186534.diff
View Options
diff --git a/usr.sbin/virtual_oss/virtual_oss/main.c b/usr.sbin/virtual_oss/virtual_oss/main.c
--- a/usr.sbin/virtual_oss/virtual_oss/main.c
+++ b/usr.sbin/virtual_oss/virtual_oss/main.c
@@ -2564,6 +2564,7 @@
main(int argc, char **argv)
{
const char *ptrerr;
+ const char *cuse_mod = "cuse.ko";
struct sigaction sa;
struct cuse_dev *pdev = NULL;
struct virtual_profile *pvp;
@@ -2583,9 +2584,17 @@
atomic_init();
- if (kldload("cuse.ko") < 0 && errno != EEXIST)
- err(1, "Failed to load cuse kernel module");
+ ptrerr = parse_options(argc, argv, 1);
+ if (ptrerr != NULL)
+ errx(EX_USAGE, "%s", ptrerr);
+
+ if (kldfind(cuse_mod) < 0 && errno == ENOENT) {
+ /* module is not loaded */
+ if (kldload("cuse.ko") < 0 && errno != EEXIST)
+ err(1, "Failed to load cuse kernel module");
+ }
+ /* cuse is loaded, initialize it */
if (cuse_init() != 0)
errx(EX_USAGE, "Could not connect to cuse module");
@@ -2599,9 +2608,6 @@
if (sigaction(SIGTERM, &sa, NULL) < 0)
err(1, "sigaction(SIGTERM)");
- ptrerr = parse_options(argc, argv, 1);
- if (ptrerr != NULL)
- errx(EX_USAGE, "%s", ptrerr);
if (voss_dsp_rx_device[0] == 0 || voss_dsp_tx_device[0] == 0)
errx(EX_USAGE, "Missing -f argument");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 9, 3:22 PM (49 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38868356
Default Alt Text
D59621.id186534.diff (1 KB)
Attached To
Mode
D59621: virtual_oss(8): Fix cuse.ko check
Attached
Detach File
Event Timeline
Log In to Comment