]> git.saurik.com Git - apple/libc.git/blobdiff - db/hash/FreeBSD/hash.c
Libc-825.24.tar.gz
[apple/libc.git] / db / hash / FreeBSD / hash.c
index 8e41d8f2d1ce5ede5500650d18fddb4b5995ff15..8c9a0c493c8598a761081cef5ac4f56da187b0e6 100644 (file)
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD: src/lib/libc/db/hash/hash.c,v 1.21 2009/03/28 07:20:39 delph
 #include <db.h>
 #include "hash.h"
 #include "page.h"
-#include "extern.h"
+#include "hash_extern.h"
 
 static int   alloc_segs(HTAB *, int);
 static int   flush_meta(HTAB *);
@@ -104,8 +104,7 @@ __hash_open(const char *file, int flags, int mode,
        int bpages, hdrsize, new_table, nsegs, save_errno;
 
        if ((flags & O_ACCMODE) == O_WRONLY) {
-               errno = EINVAL;
-               return (NULL);
+               flags += O_RDWR - O_WRONLY; /* POSIX */
        }
 
        if (!(hashp = (HTAB *)calloc(1, sizeof(HTAB))))
@@ -685,7 +684,7 @@ found:
                        return (ERROR);
                break;
        default:
-               abort();
+               LIBC_ABORT("illegal action (%d)", action);
        }
        save_bufp->flags &= ~BUF_PIN;
        return (SUCCESS);