source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: proper test for O_DIRECTORY
@ 2017-02-18 12:24 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-02-18 12:24 UTC (permalink / raw)
  To: source

Log Message:
-----------
proper test for O_DIRECTORY

Modified Files:
--------------
    mdocml:
        Makefile
        catman.c
        compat_fts.c
        configure
        configure.local.example

Added Files:
-----------
    mdocml:
        test-O_DIRECTORY.c

Revision Data
-------------
Index: catman.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/catman.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -Lcatman.c -Lcatman.c -u -p -r1.20 -r1.21
--- catman.c
+++ catman.c
@@ -41,10 +41,6 @@
 #include <time.h>
 #include <unistd.h>
 
-#ifndef O_DIRECTORY
-#define O_DIRECTORY 0
-#endif
-
 int	 process_manpage(int, int, const char *);
 int	 process_tree(int, int);
 void	 run_mandocd(int, const char *, const char *)
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/Makefile,v
retrieving revision 1.501
retrieving revision 1.502
diff -LMakefile -LMakefile -u -p -r1.501 -r1.502
--- Makefile
+++ Makefile
@@ -31,6 +31,7 @@ TESTSRCS	 = test-be32toh.c \
 		   test-mkdtemp.c \
 		   test-nanosleep.c \
 		   test-ntohl.c \
+		   test-O_DIRECTORY.c \
 		   test-ohash.c \
 		   test-PATH_MAX.c \
 		   test-pledge.c \
Index: compat_fts.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/compat_fts.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -Lcompat_fts.c -Lcompat_fts.c -u -p -r1.13 -r1.14
--- compat_fts.c
+++ compat_fts.c
@@ -63,14 +63,8 @@ static FTSENT	*fts_sort(FTS *, FTSENT *,
 static unsigned short	 fts_stat(FTS *, FTSENT *);
 
 #define	ISDOT(a)	(a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
-#ifndef	O_DIRECTORY
-#define	O_DIRECTORY	0
-#endif
 #ifndef	O_CLOEXEC
 #define	O_CLOEXEC	0
-#endif
-#ifndef	PATH_MAX
-#define	PATH_MAX	4096
 #endif
 
 #define	CLR(opt)	(sp->fts_options &= ~(opt))
Index: configure.local.example
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v
retrieving revision 1.28
retrieving revision 1.29
diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.28 -r1.29
--- configure.local.example
+++ configure.local.example
@@ -279,6 +279,7 @@ HAVE_GETSUBOPT=0
 HAVE_ISBLANK=0
 HAVE_MKDTEMP=0
 HAVE_NTOHL=0
+HAVE_O_DIRECTORY=0
 HAVE_OHASH=0
 HAVE_PATH_MAX=0
 HAVE_PLEDGE=0
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.60
retrieving revision 1.61
diff -Lconfigure -Lconfigure -u -p -r1.60 -r1.61
--- configure
+++ configure
@@ -67,6 +67,7 @@ HAVE_ISBLANK=
 HAVE_MKDTEMP=
 HAVE_NANOSLEEP=
 HAVE_NTOHL=
+HAVE_O_DIRECTORY=
 HAVE_OHASH=
 HAVE_PATH_MAX=
 HAVE_PLEDGE=
@@ -221,6 +222,7 @@ runtest getsubopt	GETSUBOPT	|| true
 runtest isblank		ISBLANK		|| true
 runtest mkdtemp		MKDTEMP		|| true
 runtest ntohl		NTOHL		|| true
+runtest O_DIRECTORY	O_DIRECTORY	|| true
 runtest PATH_MAX	PATH_MAX	|| true
 runtest pledge		PLEDGE		|| true
 runtest sandbox_init	SANDBOX_INIT	|| true
@@ -358,6 +360,7 @@ echo "#define MANPATH_DEFAULT \"${MANPAT
 [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\""
 [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
 [ ${HAVE_EFTYPE} -eq 0 ] && echo "#define EFTYPE EINVAL"
+[ ${HAVE_O_DIRECTORY} -eq 0 ] && echo "#define O_DIRECTORY 0"
 [ ${HAVE_PATH_MAX} -eq 0 ] && echo "#define PATH_MAX 4096"
 if [ ${HAVE_ENDIAN} -eq 0 -a ${HAVE_SYS_ENDIAN} -eq 0 ]; then
 	echo "#define be32toh ntohl"
--- /dev/null
+++ test-O_DIRECTORY.c
@@ -0,0 +1,7 @@
+#include <fcntl.h>
+
+int
+main(void)
+{
+	return open(".", O_RDONLY | O_DIRECTORY) == -1;
+}
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-18 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-18 12:24 mdocml: proper test for O_DIRECTORY schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).