diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-11-08 18:11:09 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-11-08 18:12:45 +0100 |
commit | 9588bc32096fc8342bfd8b989689717186d7d86e (patch) | |
tree | 774cf93f0544add18f8307714062cc18f97838da /src/login | |
parent | f842cd74eacc2960ac849766eb786059317415ee (diff) |
Remove dead code and unexport some calls
"make check-api-unused" informs us about code that is not used anymore
or that is exported but only used internally. Fix these all over the
place.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/logind-device.c | 24 | ||||
-rw-r--r-- | src/login/logind-device.h | 1 | ||||
-rw-r--r-- | src/login/logind.c | 12 | ||||
-rw-r--r-- | src/login/logind.h | 7 |
4 files changed, 18 insertions, 26 deletions
diff --git a/src/login/logind-device.c b/src/login/logind-device.c index c5fe92bd60..76c5a5c88f 100644 --- a/src/login/logind-device.c +++ b/src/login/logind-device.c @@ -54,18 +54,7 @@ Device* device_new(Manager *m, const char *sysfs, bool master) { return d; } -void device_free(Device *d) { - assert(d); - - device_detach(d); - - hashmap_remove(d->manager->devices, d->sysfs); - - free(d->sysfs); - free(d); -} - -void device_detach(Device *d) { +static void device_detach(Device *d) { Seat *s; SessionDevice *sd; @@ -87,6 +76,17 @@ void device_detach(Device *d) { } } +void device_free(Device *d) { + assert(d); + + device_detach(d); + + hashmap_remove(d->manager->devices, d->sysfs); + + free(d->sysfs); + free(d); +} + void device_attach(Device *d, Seat *s) { Device *i; bool had_master; diff --git a/src/login/logind-device.h b/src/login/logind-device.h index fa6eda7e55..c273d2bfa0 100644 --- a/src/login/logind-device.h +++ b/src/login/logind-device.h @@ -45,4 +45,3 @@ struct Device { Device* device_new(Manager *m, const char *sysfs, bool master); void device_free(Device *d); void device_attach(Device *d, Seat *s); -void device_detach(Device *d); diff --git a/src/login/logind.c b/src/login/logind.c index e334bebdf8..c4227f16b2 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -177,7 +177,7 @@ void manager_free(Manager *m) { free(m); } -int manager_enumerate_devices(Manager *m) { +static int manager_enumerate_devices(Manager *m) { struct udev_list_entry *item = NULL, *first = NULL; struct udev_enumerate *e; int r; @@ -226,7 +226,7 @@ finish: return r; } -int manager_enumerate_buttons(Manager *m) { +static int manager_enumerate_buttons(Manager *m) { struct udev_list_entry *item = NULL, *first = NULL; struct udev_enumerate *e; int r; @@ -284,7 +284,7 @@ finish: return r; } -int manager_enumerate_seats(Manager *m) { +static int manager_enumerate_seats(Manager *m) { _cleanup_closedir_ DIR *d = NULL; struct dirent *de; int r = 0; @@ -357,7 +357,7 @@ static int manager_enumerate_linger_users(Manager *m) { return r; } -int manager_enumerate_users(Manager *m) { +static int manager_enumerate_users(Manager *m) { _cleanup_closedir_ DIR *d = NULL; struct dirent *de; int r, k; @@ -401,7 +401,7 @@ int manager_enumerate_users(Manager *m) { return r; } -int manager_enumerate_sessions(Manager *m) { +static int manager_enumerate_sessions(Manager *m) { _cleanup_closedir_ DIR *d = NULL; struct dirent *de; int r = 0; @@ -449,7 +449,7 @@ int manager_enumerate_sessions(Manager *m) { return r; } -int manager_enumerate_inhibitors(Manager *m) { +static int manager_enumerate_inhibitors(Manager *m) { _cleanup_closedir_ DIR *d = NULL; struct dirent *de; int r = 0; diff --git a/src/login/logind.h b/src/login/logind.h index 9a3b9a8320..5c04d0a828 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -135,13 +135,6 @@ int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **_inhibitor); int manager_process_seat_device(Manager *m, struct udev_device *d); int manager_process_button_device(Manager *m, struct udev_device *d); -int manager_enumerate_devices(Manager *m); -int manager_enumerate_buttons(Manager *m); -int manager_enumerate_seats(Manager *m); -int manager_enumerate_sessions(Manager *m); -int manager_enumerate_users(Manager *m); -int manager_enumerate_inhibitors(Manager *m); - int manager_startup(Manager *m); int manager_run(Manager *m); int manager_spawn_autovt(Manager *m, int vtnr); |