mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 06:30:30 +00:00
logind-session-device: modernize session_device_free()
This commit is contained in:
@@ -375,8 +375,9 @@ error:
|
||||
return r;
|
||||
}
|
||||
|
||||
void session_device_free(SessionDevice *sd) {
|
||||
assert(sd);
|
||||
SessionDevice *session_device_free(SessionDevice *sd) {
|
||||
if (!sd)
|
||||
return NULL;
|
||||
|
||||
/* Make sure to remove the pushed fd. */
|
||||
if (sd->pushed_fd)
|
||||
@@ -391,7 +392,8 @@ void session_device_free(SessionDevice *sd) {
|
||||
hashmap_remove(sd->session->devices, &sd->dev);
|
||||
|
||||
free(sd->node);
|
||||
free(sd);
|
||||
|
||||
return mfree(sd);
|
||||
}
|
||||
|
||||
void session_device_complete_pause(SessionDevice *sd) {
|
||||
|
||||
@@ -28,7 +28,7 @@ struct SessionDevice {
|
||||
};
|
||||
|
||||
int session_device_new(Session *s, dev_t dev, bool open_device, SessionDevice **out);
|
||||
void session_device_free(SessionDevice *sd);
|
||||
SessionDevice *session_device_free(SessionDevice *sd);
|
||||
void session_device_complete_pause(SessionDevice *sd);
|
||||
|
||||
void session_device_resume_all(Session *s);
|
||||
|
||||
Reference in New Issue
Block a user