]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homed: rename home_setup_undo() → home_setup_done() 21023/head
authorLennart Poettering <lennart@poettering.net>
Sat, 16 Oct 2021 12:45:42 +0000 (14:45 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 16 Oct 2021 12:48:10 +0000 (14:48 +0200)
This function is a destructor, hence it should be named like one.

(We usually use xyz_free() for a destructor that frees the object passed
itself. xyz_unref() we typically use for destructors that are similar,
but ref counted. xyz_done() usually is used for destructors which free
the members of an object, but not the object itself – to allow stack
allocation of objects. We don't strictly follow this, but it's good to
stick to rules wherever we can.)

No actual code change, just renaming.

src/home/homework-cifs.c
src/home/homework-directory.c
src/home/homework-luks.c
src/home/homework.c
src/home/homework.h

index 3ae478462c71b23e05b403684064bc88073121a1..62625ab8672e511c1ecbd799123ff99d94136959 100644 (file)
@@ -102,7 +102,7 @@ int home_activate_cifs(
                 PasswordCache *cache,
                 UserRecord **ret_home) {
 
-        _cleanup_(home_setup_undo) HomeSetup setup = HOME_SETUP_INIT;
+        _cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
         _cleanup_(user_record_unrefp) UserRecord *new_home = NULL;
         const char *hdo, *hd;
         int r;
@@ -140,7 +140,7 @@ int home_activate_cifs(
 }
 
 int home_create_cifs(UserRecord *h, UserRecord **ret_home) {
-        _cleanup_(home_setup_undo) HomeSetup setup = HOME_SETUP_INIT;
+        _cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
         _cleanup_(user_record_unrefp) UserRecord *new_home = NULL;
         _cleanup_(closedirp) DIR *d = NULL;
         _cleanup_close_ int copy = -1;
index 5865f325ff382f4246c74c1ee9ff0a54f1a24c90..4e978d2328d8de8e1c291439d5c4474be3d79664 100644 (file)
@@ -30,7 +30,7 @@ int home_activate_directory(
                 UserRecord **ret_home) {
 
         _cleanup_(user_record_unrefp) UserRecord *new_home = NULL, *header_home = NULL;
-        _cleanup_(home_setup_undo) HomeSetup setup = HOME_SETUP_INIT;
+        _cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
         const char *hdo, *hd, *ipo, *ip;
         int r;
 
@@ -231,7 +231,7 @@ int home_resize_directory(
         if (r < 0)
                 return r;
 
-        r = home_setup_undo(setup);
+        r = home_setup_done(setup);
         if (r < 0)
                 return r;
 
index afee37490e536d77553c07a4f716bcc8b386da76..f302ee5f0bcfb6e8fb09e07e87e6e319cbe250ac 100644 (file)
@@ -1362,7 +1362,7 @@ int home_activate_luks(
                 UserRecord **ret_home) {
 
         _cleanup_(user_record_unrefp) UserRecord *new_home = NULL, *luks_home_record = NULL;
-        _cleanup_(home_setup_undo) HomeSetup setup = HOME_SETUP_INIT;
+        _cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
         uint64_t host_size, encrypted_size;
         const char *hdo, *hd;
         struct statfs sfs;
@@ -2999,7 +2999,7 @@ int home_resize_luks(
         if (r < 0)
                 return r;
 
-        r = home_setup_undo(setup);
+        r = home_setup_done(setup);
         if (r < 0)
                 return r;
 
index 394b5c58baf1cd4e74eae93f5f16589c31ed6149..820cafd3bd47396b61c124b0d23bd65af0808c42 100644 (file)
@@ -298,7 +298,7 @@ static void drop_caches_now(void) {
                 log_debug("Dropped caches.");
 }
 
-int home_setup_undo(HomeSetup *setup) {
+int home_setup_done(HomeSetup *setup) {
         int r = 0, q;
 
         assert(setup);
@@ -1426,7 +1426,7 @@ static int home_validate_update(UserRecord *h, HomeSetup *setup) {
 
 static int home_update(UserRecord *h, UserRecord **ret) {
         _cleanup_(user_record_unrefp) UserRecord *new_home = NULL, *header_home = NULL, *embedded_home = NULL;
-        _cleanup_(home_setup_undo) HomeSetup setup = HOME_SETUP_INIT;
+        _cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
         _cleanup_(password_cache_free) PasswordCache cache = {};
         bool already_activated = false;
         int r;
@@ -1469,7 +1469,7 @@ static int home_update(UserRecord *h, UserRecord **ret) {
         if (r < 0)
                 return r;
 
-        r = home_setup_undo(&setup);
+        r = home_setup_done(&setup);
         if (r < 0)
                 return r;
 
@@ -1480,7 +1480,7 @@ static int home_update(UserRecord *h, UserRecord **ret) {
 }
 
 static int home_resize(UserRecord *h, UserRecord **ret) {
-        _cleanup_(home_setup_undo) HomeSetup setup = HOME_SETUP_INIT;
+        _cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
         _cleanup_(password_cache_free) PasswordCache cache = {};
         bool already_activated = false;
         int r;
@@ -1520,7 +1520,7 @@ static int home_resize(UserRecord *h, UserRecord **ret) {
 static int home_passwd(UserRecord *h, UserRecord **ret_home) {
         _cleanup_(user_record_unrefp) UserRecord *header_home = NULL, *embedded_home = NULL, *new_home = NULL;
         _cleanup_(strv_free_erasep) char **effective_passwords = NULL;
-        _cleanup_(home_setup_undo) HomeSetup setup = HOME_SETUP_INIT;
+        _cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
         _cleanup_(password_cache_free) PasswordCache cache = {};
         bool already_activated = false;
         int r;
@@ -1583,7 +1583,7 @@ static int home_passwd(UserRecord *h, UserRecord **ret_home) {
         if (r < 0)
                 return r;
 
-        r = home_setup_undo(&setup);
+        r = home_setup_done(&setup);
         if (r < 0)
                 return r;
 
@@ -1595,7 +1595,7 @@ static int home_passwd(UserRecord *h, UserRecord **ret_home) {
 
 static int home_inspect(UserRecord *h, UserRecord **ret_home) {
         _cleanup_(user_record_unrefp) UserRecord *header_home = NULL, *new_home = NULL;
-        _cleanup_(home_setup_undo) HomeSetup setup = HOME_SETUP_INIT;
+        _cleanup_(home_setup_done) HomeSetup setup = HOME_SETUP_INIT;
         _cleanup_(password_cache_free) PasswordCache cache = {};
         bool already_activated = false;
         int r;
@@ -1625,7 +1625,7 @@ static int home_inspect(UserRecord *h, UserRecord **ret_home) {
         if (r < 0)
                 return r;
 
-        r = home_setup_undo(&setup);
+        r = home_setup_done(&setup);
         if (r < 0)
                 return r;
 
index b16f4a9086c9187e4b70850f8b276493a71d23d8..1bb985a44d2b1b8081ca19c7d397667b9c4c984c 100644 (file)
@@ -54,7 +54,7 @@ void password_cache_free(PasswordCache *cache);
                 .partition_size = UINT64_MAX,           \
         }
 
-int home_setup_undo(HomeSetup *setup);
+int home_setup_done(HomeSetup *setup);
 
 int home_setup(UserRecord *h, bool already_activated, PasswordCache *cache, HomeSetup *setup, UserRecord **ret_header_home);