From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id r910qwW9032097 for ; Mon, 30 Sep 2013 20:52:58 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id r910qwx4004136; Mon, 30 Sep 2013 20:52:58 -0400 (EDT) Date: Mon, 30 Sep 2013 20:52:58 -0400 (EDT) Message-Id: <201310010052.r910qwx4004136@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Fix build on Solaris. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Fix build on Solaris. Initial version for SmartOS by ONODERA Ryo . Generalized for Solaris by Jonathan Perkin . Received via Thomas Klausner . 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 #include -#if defined(__linux__) +#if defined(__linux__) || defined(__sun) # include # include #elif defined(__APPLE__) @@ -44,6 +44,10 @@ # include #endif +#if defined(__sun) +#include +#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