source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Fix build on Solaris.
@ 2013-10-01  0:52 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2013-10-01  0:52 UTC (permalink / raw)
  To: source

Log Message:
-----------
Fix build on Solaris.
Initial version for SmartOS by ONODERA Ryo <ryoon at netbsd dot org>.
Generalized for Solaris by Jonathan Perkin <jperkin at netbsd dot org>.
Received via Thomas Klausner <wiz at netbsd dot org>.
Style cleanup by myself.

Tags:
----
VERSION_1_12

Modified Files:
--------------
    mdocml:
        mandocdb.c

Revision Data
-------------
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.49.2.5
retrieving revision 1.49.2.6
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.49.2.5 -r1.49.2.6
--- mandocdb.c
+++ mandocdb.c
@@ -34,7 +34,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__sun)
 # include <endian.h>
 # include <db_185.h>
 #elif defined(__APPLE__)
@@ -44,6 +44,10 @@
 # include <db.h>
 #endif
 
+#if defined(__sun)
+#include <sys/stat.h>
+#endif
+
 #include "man.h"
 #include "mdoc.h"
 #include "mandoc.h"
@@ -1756,6 +1760,9 @@ ofile_dirbuild(const char *dir, const ch
 		int p_src_form, struct of **of)
 {
 	char		 buf[PATH_MAX];
+#if defined(__sun)
+	struct stat	 sb;
+#endif
 	size_t		 sz;
 	DIR		*d;
 	const char	*fn, *sec, *arch;
@@ -1778,7 +1785,12 @@ ofile_dirbuild(const char *dir, const ch
 
 		src_form = p_src_form;
 
+#if defined(__sun)
+		stat(dp->d_name, &sb);
+		if (S_IFDIR & sb.st_mode) {
+#else
 		if (DT_DIR == dp->d_type) {
+#endif
 			sec = psec;
 			arch = parch;
 
@@ -1835,7 +1847,11 @@ ofile_dirbuild(const char *dir, const ch
 			continue;
 		}
 
+#if defined(__sun)
+		if (0 == S_IFREG & sb.st_mode) {
+#else
 		if (DT_REG != dp->d_type) {
+#endif
 			if (warnings)
 				fprintf(stderr,
 				    "%s/%s: not a regular file\n",
--
 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:[~2013-10-01  0:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-01  0:52 mdocml: Fix build on Solaris 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).