Page MenuHomeFreeBSD

virtual_oss: Clean up cuse on exit
AbandonedPublic

Authored by christos on May 23 2025, 5:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 29, 6:10 PM
Unknown Object (File)
Tue, Nov 25, 8:38 PM
Unknown Object (File)
Tue, Nov 25, 1:57 AM
Unknown Object (File)
Sat, Nov 22, 10:45 PM
Unknown Object (File)
Sat, Nov 22, 10:29 PM
Unknown Object (File)
Tue, Nov 18, 9:59 AM
Unknown Object (File)
Nov 15 2025, 11:13 PM
Unknown Object (File)
Nov 12 2025, 6:05 AM
Subscribers
None

Details

Summary

Sponsored by: The FreeBSD Foundation

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

virtual_main.c
2657

You don't need to do this cleanup if we exit due to an error?

virtual_main.c
2657

If we do get here, then both cuse and the cuse device will have been initialized. Or do you mean something else?

virtual_main.c
2657

I mean, if we call cuse_init(), then hit an error and call err(), we'll exit without having called cuse_uninit(). Is that ok? Should we be using atexit() instead?

virtual_main.c
2657

Ah that's what you meant. You are right. Do you think it's better to use atexit() or just call cuse_uninit() on every error path?

2657

Because there are various error paths I would personally go with atexit().

markj added inline comments.
virtual_main.c
2657

Well, it looks like cuse_uninit() isn't doing anything special, unlike cuse_dev_destroy(), which issues an ioctl to destroy the created cuse device. So as in the other review regarding cleanup on exit, that call isn't really important. I wouldn't spend much time on it.

This revision is now accepted and ready to land.May 27 2025, 1:10 PM
This revision now requires review to proceed.May 28 2025, 3:31 PM