]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Assume RLIMIT_CORE is defined
authorAlejandro Colomar <alx@kernel.org>
Fri, 2 Dec 2022 21:49:57 +0000 (22:49 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 15 Dec 2022 22:22:05 +0000 (16:22 -0600)
It is required by POSIX.1-2001.

Cc: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
libmisc/limits.c
libmisc/pwd_init.c

index 372a8c3bf1544e0ba8a4403da483927ef3bc93ed..846dd54a8ac76323c6e772757515f1d42fa4e772 100644 (file)
@@ -246,13 +246,11 @@ static int do_user_limits (const char *buf, const char *name)
                        retval |= setrlimit_value (RLIMIT_AS, pp, 1024);
                        break;
 #endif
-#ifdef RLIMIT_CORE
                case 'c':
                case 'C':
                        /* RLIMIT_CORE - max core file size (KB) */
                        retval |= setrlimit_value (RLIMIT_CORE, pp, 1024);
                        break;
-#endif
 #ifdef RLIMIT_DATA
                case 'd':
                case 'D':
index 3c3d96e703d7ee7180e991df8622980d1d86a38e..eb2bddf1cb0bdd09d924a1d7527b75808c51bc60 100644 (file)
@@ -28,10 +28,9 @@ void pwd_init (void)
 {
        struct rlimit rlim;
 
-#ifdef RLIMIT_CORE
        rlim.rlim_cur = rlim.rlim_max = 0;
        setrlimit (RLIMIT_CORE, &rlim);
-#endif
+
        rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY;
 #ifdef RLIMIT_AS
        setrlimit (RLIMIT_AS, &rlim);