summaryrefslogtreecommitdiff
path: root/archivers/rpm4/files/patch-misc_fts.c
blob: d381be50208f378500d02f320c1785e2af92cfdf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- misc/fts.c.orig	2018-08-25 09:14:19 UTC
+++ misc/fts.c
@@ -32,12 +32,14 @@ static char sccsid[] = "@(#)fts.c	8.6 (B
 #endif /* LIBC_SCCS and not lint */
 
 /* Conditional to set up proper fstat64 implementation */
-#if defined(hpux) || defined(sun)
+#if defined(hpux) || defined(__FreeBSD__) || defined(sun)
 #   define FTS_FSTAT64(_fd, _sbp)   fstat((_fd), (_sbp))
 #else
 #   define FTS_FSTAT64(_fd, _sbp)   fstat64((_fd), (_sbp))
 #endif
 
+#include "system.h"
+#include "misc/rpmfts.h"
 #if defined(_LIBC)
 #include <sys/param.h>
 #include <include/sys/stat.h>
@@ -51,7 +53,7 @@ static char sccsid[] = "@(#)fts.c	8.6 (B
 #else
 
 /* Conditionals for working around non-GNU environments */
-#if defined(hpux)
+#if defined(hpux) || defined(__FreeBSD__)
 #   define        _INCLUDE_POSIX_SOURCE
 #   define __errno_location() 	(&errno)
 #   define dirfd(dirp)		-1
@@ -65,11 +67,9 @@ static char sccsid[] = "@(#)fts.c	8.6 (B
 #   define __errno_location()	(__error())
 #endif
 
-#include "system.h"
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include "misc/rpmfts.h"
 #   define __set_errno(val) (*__errno_location ()) = (val)
 #   define __open	open
 #   define __close	close