source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Fix build on Solaris.
Date: Mon, 30 Sep 2013 20:52:58 -0400 (EDT)	[thread overview]
Message-ID: <201310010052.r910qwx4004136@krisdoz.my.domain> (raw)

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

                 reply	other threads:[~2013-10-01  0:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201310010052.r910qwx4004136@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).