Fix for QNX. stat doesn't have st_blksize. XPCOM20_BASE
authorbriano%netscape.com
Thu, 13 May 1999 03:04:42 +0000
changeset 130 a68ad6ea6f21ac1e4d9dffb60d2dae48f9155b74
parent 129 a493f27a964b232184d8b50a3688e97d336c0986
child 131 6a7370745acd572d00d839677ea261bccf914977
child 132 878b45f1eabc199c39adaf99a4d3c0b3ac62b053
push idunknown
push userunknown
push dateunknown
Fix for QNX. stat doesn't have st_blksize.
dbm/src/hash.c
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -407,17 +407,21 @@ init_hash(HTAB *hashp, const char *file,
 	memset(hashp->BITMAPS, 0, sizeof (hashp->BITMAPS));
 
 	/* Fix bucket size to be optimal for file system */
 	if (file != NULL) {
 		if (stat(file, &statbuf))
 			return (NULL);
 
 #if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
+#ifdef QNX
+		hashp->BSIZE = statbuf.st_size;
+#else
 		hashp->BSIZE = statbuf.st_blksize;
+#endif
 
        	/* new code added by Lou to reduce block
        	 * size down below MAX_BSIZE
        	 */
        	if (hashp->BSIZE > MAX_BSIZE)
        		hashp->BSIZE = MAX_BSIZE;
 #endif
 		hashp->BSHIFT = __log2(hashp->BSIZE);