login: add callback for close_range()

Let's make it more robust for old kernels where is no close_range() or
in cases when it's unsuccessful.

Reported-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2021-07-15 12:51:39 +02:00
parent 913829559b
commit cae071ed72
3 changed files with 5 additions and 10 deletions

View file

@ -91,9 +91,7 @@ static inline int close_range(unsigned int first, unsigned int last, int flags)
# endif /* SYS_close_range */
#endif /* __linux__ */
#ifndef HAVE_CLOSE_RANGE
extern void ul_close_all_fds(unsigned int first, unsigned int last);
#endif
#define UL_COPY_READ_ERROR (-1)
#define UL_COPY_WRITE_ERROR (-2)