# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1330752063 0 # Node ID ff844a41193ba549a924be0788877f7a0473cd9b # Parent d7fcea7bfcf9a55b2976e1acb9528404a1fbf30a Not setting the structure to NULL seems to cause crashes on Mac when mounting/unmounting. diff -r d7fcea7bfcf9 -r ff844a41193b dwcompat.c --- 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);