NetBSD Problem Report #35928

From dauphin@enst.fr  Mon Mar  5 18:17:41 2007
Return-Path: <dauphin@enst.fr>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 55B5863B896
	for <gnats-bugs@gnats.netbsd.org>; Mon,  5 Mar 2007 18:17:41 +0000 (UTC)
Message-Id: <1173118655.24898@bi.enst.fr>
Date: Mon, 5 Mar 2007 19:17:35 +0100
From: "Gilles Dauphin" <dauphin@enst.fr>
To: "gnats bugs" <gnats-bugs@NetBSD.org>
Subject: blender modern solaris 64bit gcc
X-Send-Pr-Version: gtk-send-pr 0.4.5 
X-GNATS-Notify:

>Number:         35928
>Category:       pkg
>Synopsis:       blender modern solaris 64bit gcc
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    solaris-pkg-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 05 18:20:00 +0000 2007
>Last-Modified:  Tue Mar 06 00:03:17 +0000 2007
>Originator:     Gilles Dauphin
>Release:        SunOS 5.10 i86pc
>Organization:
ENST 
>Environment:


System: SunOS bi.enst.fr 5.10 Generic_118855-19 i86pc


>Description:


blender crash when saving file or opening one
problem is in source/blender/blenlib/intern/storage.c
statfs() is not available on 64bit ABI. its an obsolete feature.
use statvfs instead


>How-To-Repeat:


run blender on solaris


>Fix:


--- patch-ab begins here ---
--- source/blender/blenlib/intern/storage.c.orig	Wed Jul 27 22:16:37 2005
+++ source/blender/blenlib/intern/storage.c	Mon Mar  5 18:57:10 2007
@@ -50,7 +50,11 @@
 #include <time.h>
 #include <sys/stat.h>

-#if !defined(linux) && (defined(__sgi) || defined(__sun__) || defined(__sun) || defined(__sparc) || defined(__sparc__))
+#if defined(__DragonFly__) || defined(__sun__) || defined(__sun) 
+#include <sys/statvfs.h>
+#endif
+
+#if !defined(linux) && defined(__sgi) 
 #include <sys/statfs.h>
 #endif

@@ -89,10 +93,6 @@
 #include <pwd.h>
 #endif

-#if !defined(__FreeBSD__) && !defined(__APPLE__)
-#include <malloc.h>
-#endif
-
 /* lib includes */
 #include "MEM_guardedalloc.h"

@@ -177,7 +177,11 @@

 	return (double) (freec*bytesps*sectorspc);
 #else
+#if defined(__DragonFly__) || defined(__sun__) || defined(__sun) || (defined (__NetBSD__) && __NetBSD_Version__ >= 299000900) /* 2.99.9 */
+	struct statvfs disk;
+#else
 	struct statfs disk;
+#endif
 	char name[100],*slash;


@@ -188,16 +192,19 @@
 		if (slash) slash[1] = 0;
 	} else strcpy(name,"/");

-#if defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || defined (__APPLE__) 
+#if defined(__DragonFly__) || defined(__sun__) || defined(__sun) || (defined (__NetBSD__) && __NetBSD_Version__ >= 299000900) /* 2.99.9 */
+	if (statvfs(name, &disk)) return(-1);
+#elif defined (__FreeBSD__) || defined (linux) || defined (__OpenBSD__) || \
+      defined (__APPLE__) || defined (__NetBSD__)
 	if (statfs(name, &disk)) return(-1);
 #endif
 #ifdef __BeOS
 	return -1;
 #endif
-#if !defined(linux) && (defined (__sgi) || defined (__sun__) || defined (__sun) || defined(__sparc) || defined(__sparc__))
+#if !defined(linux) && defined (__sgi)  

 	if (statfs(name, &disk, sizeof(struct statfs), 0)){
-		/* printf("diskfree: Couldn't get information about %s.\n",dir); */
+		printf("diskfree: Couldn't get information about %s.\n",dir);
 		return(-1);
 	}
 #endif
--- patch-ab ends here ---



>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: wiz@netbsd.org
Responsible-Changed-When: Tue, 06 Mar 2007 00:03:17 +0000
Responsible-Changed-Why:
Solaris pkgsrc problem.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.