Solaris-specific fixes

Hi, I’m OpenIndiana user, and found that 7.2ce release is not building on it (and I guess on other solaris forks too). This patch demonstrates whan have to be changed. I don’t say it is a good fix and have to be integrated as is, but this is what I need to have it building at least.

diff --git c/src/libc/stdio.h w/src/libc/stdio.h
index 12ba9b9..7a1f876 100644
--- c/src/libc/stdio.h
+++ w/src/libc/stdio.h
@@ -276,7 +276,9 @@ char    *tmpnam(char *);
 int     vsprintf(char * __restrict, const char * __restrict, va_list);
 #endif
 
+#ifndef __sun
 int    rename(const char *src, const char *dst);
+#endif
 
 /*
  * Bk extension
diff --git c/src/libc/utils/dirs.c w/src/libc/utils/dirs.c
index 24a94bd..fd9e1a3 100644
--- c/src/libc/utils/dirs.c
+++ w/src/libc/utils/dirs.c
@@ -186,7 +186,7 @@ getdir(char *dir)
 {
    char    **lines = 0;
    DIR *d;
-   int type;
+   int type = '?';
    struct  dirent   *e;
 
    unless (d = opendir(dir)) {
@@ -198,12 +198,14 @@ getdir(char *dir)
        if (streq(e->d_name, ".") || streq(e->d_name, "..")) {
            continue;
        }
+#ifndef __sun
        switch (e->d_type) {
            case DT_DIR: type = 'd'; break;
            case DT_REG: type = 'f'; break;
            case DT_LNK: type = 'l'; break;
            default: type = '?'; break;
        }
+#endif
        lines = addLine(lines, aprintf("%s%c%c", e->d_name, 0, type));
    }
    closedir(d);

Cool, thanks.

Clearly, after Cantrell’s comments yesterday we need to spin up an Illumos VM and include that in our builds. Thanks for the fixes. Those changes look correct. The getdir() function used to include code like this but it was dropped on some reorg.

I pushed these patches to bk://bkbits.net/u/bk/bugfix

BTW: working on writing up how people can submit patches directly.

Thanks. Is there way to download tarball from bkbits?

Nope. bkbits is pretty limited at the moment.

You can clone it using bk: bk clone bk://bkbits.net/u/bk/bugfix
and you can pull from that URL into an existing repository.

Also http:// will work for the URL if you need to use a proxy.