]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Remove preprocessor conditionals that are always true
authorAlejandro Colomar <alx@kernel.org>
Fri, 2 Dec 2022 21:22:55 +0000 (22:22 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 15 Dec 2022 22:22:05 +0000 (16:22 -0600)
Since the last commit, LIMITS is always defined.  Remove the dummy
macro, and all conditionals on it.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
libmisc/limits.c

index 5e34905b3812a828f23c6f07bf87fed2d98b9254..372a8c3bf1544e0ba8a4403da483927ef3bc93ed 100644 (file)
@@ -29,8 +29,6 @@
 #include "getdef.h"
 #include "shadowlog.h"
 #include <sys/resource.h>
-#define LIMITS
-#ifdef LIMITS
 #ifndef LIMITS_FILE
 #define LIMITS_FILE "/etc/limits"
 #endif
@@ -477,7 +475,6 @@ static int setup_user_limits (const char *uname)
        }
        return do_user_limits (limits, uname);
 }
-#endif                         /* LIMITS */
 
 
 static void setup_usergroups (const struct passwd *info)
@@ -521,7 +518,6 @@ void setup_limits (const struct passwd *info)
         */
 
        if (getdef_bool ("QUOTAS_ENAB")) {
-#ifdef LIMITS
                if (info->pw_uid != 0) {
                        if ((setup_user_limits (info->pw_name) & LOGIN_ERROR_LOGIN) != 0) {
                                (void) fputs (_("Too many logins.\n"), log_get_logfd());
@@ -529,7 +525,6 @@ void setup_limits (const struct passwd *info)
                                exit (EXIT_FAILURE);
                        }
                }
-#endif
                for (cp = info->pw_gecos; cp != NULL; cp = strchr (cp, ',')) {
                        if (',' == *cp) {
                                cp++;