From: Dmitry V. Levin Date: Fri, 14 Jul 2023 08:00:00 +0000 (+0000) Subject: homework: cleanup use of ERRNO_IS_NOT_SUPPORTED() X-Git-Tag: v255-rc1~886^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9e1f42401468ecaa3a1f51cf3e32f25b107bd4d;p=thirdparty%2Fsystemd.git homework: cleanup use of ERRNO_IS_NOT_SUPPORTED() Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_NOT_SUPPORTED() is the value returned by home_update_quota_auto() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_NOT_SUPPORTED() invocation to the branch where the return value is known to be negative. --- diff --git a/src/home/homework-directory.c b/src/home/homework-directory.c index 6668edb7491..575ac525512 100644 --- a/src/home/homework-directory.c +++ b/src/home/homework-directory.c @@ -285,10 +285,11 @@ int home_resize_directory( return r; r = home_update_quota_auto(h, NULL); - if (ERRNO_IS_NOT_SUPPORTED(r)) - return -ESOCKTNOSUPPORT; /* make recognizable */ - if (r < 0) + if (r < 0) { + if (ERRNO_IS_NOT_SUPPORTED(r)) + return -ESOCKTNOSUPPORT; /* make recognizable */ return r; + } r = home_store_embedded_identity(new_home, setup->root_fd, h->uid, embedded_home); if (r < 0)