changeset 1608:ff844a41193b

Not setting the structure to NULL seems to cause crashes on Mac when mounting/unmounting.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 03 Mar 2012 05:21:03 +0000
parents d7fcea7bfcf9
children e4a641036581
files dwcompat.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dwcompat.c	Fri Mar 02 14:19:55 2012 +0000
+++ b/dwcompat.c	Sat Mar 03 05:21:03 2012 +0000
@@ -102,7 +102,7 @@
 
 	return (long double)((double)spc*(double)bps*(double)fc);
 #elif defined(__FreeBSD__) || defined(__MAC__)
-	struct statfs *fsp;
+	struct statfs *fsp = NULL;
 	int entries, index = 1;
 
 	entries = getmntinfo (&fsp, MNT_NOWAIT);
@@ -204,7 +204,7 @@
 
 	return (long double)((double)spc*(double)bps*(double)tc);
 #elif defined(__FreeBSD__) || defined(__MAC__)
-	struct statfs *fsp;
+	struct statfs *fsp = NULL;
 	int entries, index = 1;
 
 	entries = getmntinfo (&fsp, MNT_NOWAIT);
@@ -303,7 +303,7 @@
 	if(GetVolumeInformation(buffer, volname, 100, &spc, &bps, &fc, NULL, 0) != 0)
 		return 1;
 #elif defined(__FreeBSD__) || defined(__MAC__)
-	struct statfs *fsp;
+	struct statfs *fsp = NULL;
 	int entries, index = 1;
 
 	entries = getmntinfo (&fsp, MNT_NOWAIT);
@@ -374,7 +374,7 @@
 {
 #if defined(__UNIX__) || defined(__MAC__) 
 #if defined(__FreeBSD__) || defined(__MAC__)
-	struct statfs *fsp;
+	struct statfs *fsp = NULL;
 	int entries, index = 1;
 
 	strncpy(buf, "Unknown", len);