Add indentation to heavy use of preprocessor conditionals

This clarifies which code is under which conditions,
for further clenaup.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2022-12-02 21:58:14 +01:00 committed by Serge Hallyn
parent 7b1fc83e9b
commit 0527fa677b
2 changed files with 26 additions and 26 deletions

View File

@ -31,32 +31,32 @@ void pwd_init (void)
#ifdef HAVE_SYS_RESOURCE_H #ifdef HAVE_SYS_RESOURCE_H
struct rlimit rlim; struct rlimit rlim;
#ifdef RLIMIT_CORE # ifdef RLIMIT_CORE
rlim.rlim_cur = rlim.rlim_max = 0; rlim.rlim_cur = rlim.rlim_max = 0;
setrlimit (RLIMIT_CORE, &rlim); setrlimit (RLIMIT_CORE, &rlim);
#endif # endif
rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY; rlim.rlim_cur = rlim.rlim_max = RLIM_INFINITY;
#ifdef RLIMIT_AS # ifdef RLIMIT_AS
setrlimit (RLIMIT_AS, &rlim); setrlimit (RLIMIT_AS, &rlim);
#endif # endif
#ifdef RLIMIT_CPU # ifdef RLIMIT_CPU
setrlimit (RLIMIT_CPU, &rlim); setrlimit (RLIMIT_CPU, &rlim);
#endif # endif
#ifdef RLIMIT_DATA # ifdef RLIMIT_DATA
setrlimit (RLIMIT_DATA, &rlim); setrlimit (RLIMIT_DATA, &rlim);
#endif # endif
#ifdef RLIMIT_FSIZE # ifdef RLIMIT_FSIZE
setrlimit (RLIMIT_FSIZE, &rlim); setrlimit (RLIMIT_FSIZE, &rlim);
#endif # endif
#ifdef RLIMIT_NOFILE # ifdef RLIMIT_NOFILE
setrlimit (RLIMIT_NOFILE, &rlim); setrlimit (RLIMIT_NOFILE, &rlim);
#endif # endif
#ifdef RLIMIT_RSS # ifdef RLIMIT_RSS
setrlimit (RLIMIT_RSS, &rlim); setrlimit (RLIMIT_RSS, &rlim);
#endif # endif
#ifdef RLIMIT_STACK # ifdef RLIMIT_STACK
setrlimit (RLIMIT_STACK, &rlim); setrlimit (RLIMIT_STACK, &rlim);
#endif # endif
#else /* !HAVE_SYS_RESOURCE_H */ #else /* !HAVE_SYS_RESOURCE_H */
set_filesize_limit (30000); set_filesize_limit (30000);
/* don't know how to set the other limits... */ /* don't know how to set the other limits... */

View File

@ -12,18 +12,18 @@
#ident "$Id$" #ident "$Id$"
#if HAVE_ULIMIT_H #if HAVE_ULIMIT_H
#include <ulimit.h> # include <ulimit.h>
#ifndef UL_SETFSIZE # ifndef UL_SETFSIZE
#ifdef UL_SFILLIM # ifdef UL_SFILLIM
#define UL_SETFSIZE UL_SFILLIM # define UL_SETFSIZE UL_SFILLIM
#else # else
#define UL_SETFSIZE 2 # define UL_SETFSIZE 2
#endif # endif
#endif # endif
#elif HAVE_SYS_RESOURCE_H #elif HAVE_SYS_RESOURCE_H
#include <sys/time.h> /* for struct timeval on sunos4 */ # include <sys/time.h> /* for struct timeval on sunos4 */
/* XXX - is the above ok or should it be <time.h> on ultrix? */ /* XXX - is the above ok or should it be <time.h> on ultrix? */
#include <sys/resource.h> # include <sys/resource.h>
#endif #endif
#include "prototypes.h" #include "prototypes.h"