Fix error codes.
[oweals/openssl.git] / apps / ca.c
index e9d79def61d7086990d10d5b404d7089f271db3c..7bd229139ecc05c40ee59294436a63e4dbb9d58a 100644 (file)
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -83,7 +83,7 @@
 #    else
 #      include <unixlib.h>
 #    endif
-#  elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_NETWARE)
+#  elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_NETWARE) && !defined(__TANDEM)
 #    include <sys/file.h>
 #  endif
 #endif
@@ -858,8 +858,8 @@ bad:
                        perror(outdir);
                        goto err;
                        }
-#ifdef S_IFDIR
-               if (!(sb.st_mode & S_IFDIR))
+#ifdef S_ISDIR
+               if (!S_ISDIR(sb.st_mode))
                        {
                        BIO_printf(bio_err,"%s need to be a directory\n",outdir);
                        perror(outdir);
@@ -2882,13 +2882,22 @@ int old_entry_print(BIO *bp, ASN1_OBJECT *obj, ASN1_STRING *str)
        p=(char *)str->data;
        for (j=str->length; j>0; j--)
                {
+#ifdef CHARSET_EBCDIC
+               if ((*p >= 0x20) && (*p <= 0x7e))
+                       BIO_printf(bp,"%c",os_toebcdic[*p]);
+#else
                if ((*p >= ' ') && (*p <= '~'))
                        BIO_printf(bp,"%c",*p);
+#endif
                else if (*p & 0x80)
                        BIO_printf(bp,"\\0x%02X",*p);
                else if ((unsigned char)*p == 0xf7)
                        BIO_printf(bp,"^?");
+#ifdef CHARSET_EBCDIC
+               else    BIO_printf(bp,"^%c",os_toebcdic[*p+0x40]);
+#else
                else    BIO_printf(bp,"^%c",*p+'@');
+#endif
                p++;
                }
        BIO_printf(bp,"'\n");