Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdfp-pipe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvdfp-pipe
Commits
1b7b6bd8
Unverified
Commit
1b7b6bd8
authored
Aug 01, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update vsub.c from varnish-cache
parent
b9205c4e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
7 deletions
+48
-7
configure.ac
configure.ac
+24
-0
vsub.c
src/from_varnish/vsub.c
+24
-7
No files found.
configure.ac
View file @
1b7b6bd8
...
...
@@ -5,6 +5,7 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR(src/vdfp_pipe.vcc)
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET
AC_GNU_SOURCE
AC_LANG(C)
AM_INIT_AUTOMAKE([1.12 -Wall -Werror foreign parallel-tests])
...
...
@@ -77,6 +78,29 @@ AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
LIBS="${save_LIBS}"
AC_CHECK_FUNCS([close_range])
# Check for working close_range()
if test "$ac_cv_func_close_range" = yes; then
AC_CACHE_CHECK([if close_range is working],
[ac_cv_have_working_close_range],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
#include <unistd.h>
]],[[
return (close_range(0, 2, 0));
]])],
[ac_cv_have_working_close_range=yes],
[ac_cv_have_working_close_range=no])
])
fi
if test "x$ac_cv_have_working_close_range" = xyes; then
AC_DEFINE([HAVE_WORKING_CLOSE_RANGE], [1],
[Define if OS has working close_range()])
fi
# --enable-stack-protector
AC_ARG_ENABLE(stack-protector,
AS_HELP_STRING([--enable-stack-protector],[enable stack protector (default is YES)]),
...
...
src/from_varnish/vsub.c
View file @
1b7b6bd8
...
...
@@ -33,27 +33,43 @@
#include "config.h"
#include <sys/types.h>
#include <unistd.h>
#include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#ifndef HAVE_CLOSEFROM
#include <stdint.h>
#include <stdlib.h> // Solaris closefrom(3c)
#include <string.h>
#include <unistd.h> // BSD/Linux close_range(2)
#ifdef HAVE_WORKING_CLOSE_RANGE
#elif HAVE_CLOSEFROM
#else
# include <dirent.h>
#endif
#include "vdef.h"
#include "vas.h"
#include "vapi/vsig.h"
#include "vas.h"
#include "vfil.h"
#include "vsb.h"
#include "vsub.h"
struct
vsub_priv
{
const
char
*
name
;
struct
vsb
*
sb
;
int
lines
;
int
maxlines
;
};
void
VSUB_closefrom
(
int
fd
)
{
assert
(
fd
>=
0
);
#ifdef HAVE_CLOSEFROM
#ifdef HAVE_WORKING_CLOSE_RANGE
AZ
(
close_range
(
fd
,
~
0U
,
0
));
return
;
#elif HAVE_CLOSEFROM
closefrom
(
fd
);
return
;
#else
...
...
@@ -86,3 +102,4 @@ VSUB_closefrom(int fd)
(
void
)
close
(
maxfd
);
#endif
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment