* mdocml: Thomas Klausner <wiz at NetBSD dot org> finally succeeded to
@ 2013-10-11 0:06 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2013-10-11 0:06 UTC (permalink / raw)
To: source
Log Message:
-----------
Thomas Klausner <wiz at NetBSD dot org> finally succeeded to build
on SmartOS and sent these additional patches, thanks!
Tags:
----
VERSION_1_12
Modified Files:
--------------
mdocml:
catman.c
cgi.c
Revision Data
-------------
Index: catman.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/Attic/catman.c,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -Lcatman.c -Lcatman.c -u -p -r1.11.2.1 -r1.11.2.2
--- catman.c
+++ catman.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <unistd.h>
-#ifdef __linux__
+#if defined(__linux__) || defined(__sun)
# include <db_185.h>
#else
# include <db.h>
Index: cgi.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/cgi.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -Lcgi.c -Lcgi.c -u -p -r1.45 -r1.46
--- cgi.c
+++ cgi.c
@@ -34,6 +34,13 @@
#include <string.h>
#include <unistd.h>
+#if defined(__sun)
+/* for stat() */
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+
#include "apropos_db.h"
#include "mandoc.h"
#include "mdoc.h"
@@ -42,7 +49,7 @@
#include "manpath.h"
#include "mandocdb.h"
-#ifdef __linux__
+#if defined(__linux__) || defined(__sun)
# include <db_185.h>
#else
# include <db.h>
@@ -1097,11 +1104,20 @@ static int
pathstop(DIR *dir)
{
struct dirent *d;
+#if defined(__sun)
+ struct stat sb;
+#endif
- while (NULL != (d = readdir(dir)))
+ while (NULL != (d = readdir(dir))) {
+#if defined(__sun)
+ stat(d->d_name, &sb);
+ if (S_IFREG & sb.st_mode)
+#else
if (DT_REG == d->d_type)
+#endif
if (0 == strcmp(d->d_name, "catman.conf"))
return(1);
+ }
return(0);
}
@@ -1118,6 +1134,9 @@ pathgen(DIR *dir, char *path, struct req
DIR *cd;
int rc;
size_t sz, ssz;
+#if defined(__sun)
+ struct stat sb;
+#endif
sz = strlcat(path, "/", PATH_MAX);
if (sz >= PATH_MAX) {
@@ -1133,7 +1152,13 @@ pathgen(DIR *dir, char *path, struct req
rc = 0;
while (0 == rc && NULL != (d = readdir(dir))) {
- if (DT_DIR != d->d_type || strcmp(d->d_name, "etc"))
+#if defined(__sun)
+ stat(d->d_name, &sb);
+ if (!(S_IFDIR & sb.st_mode)
+#else
+ if (DT_DIR != d->d_type
+#endif
+ || strcmp(d->d_name, "etc"))
continue;
path[(int)sz] = '\0';
@@ -1182,7 +1207,13 @@ pathgen(DIR *dir, char *path, struct req
rewinddir(dir);
while (NULL != (d = readdir(dir))) {
- if (DT_DIR != d->d_type || '.' == d->d_name[0])
+#if defined(__sun)
+ stat(d->d_name, &sb);
+ if (!(S_IFDIR & sb.st_mode)
+#else
+ if (DT_DIR != d->d_type
+#endif
+ || '.' == d->d_name[0])
continue;
path[(int)sz] = '\0';
--
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-11 0:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-11 0:06 mdocml: Thomas Klausner <wiz at NetBSD dot org> finally succeeded to 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).