/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
unsigned int matchlen;
const char *cpath = path.c_str();
char best[PATH_MAX+1];
-
+
if ((mntf = setmntent ("/etc/mtab", "r")) == 0) {
return "";
}
n = 0;
matchlen = 0;
- /* note: strcmp's semantics are not
+ /* note: strcmp's semantics are not
strict enough to use for this.
*/
}
#elif defined(PLATFORM_WINDOWS)
-
+#include <assert.h>
string
mountpoint (string path)
{
- // TODO ... if needed
+ /* this function is currently only called from 'old_peak_path()'
+ * via find_broken_peakfile() - only relevant for loading pre
+ * libsndfile Ardour 2.0 sessions.
+ */
+ assert(0);
+ return ""; // TODO ... if needed
}
#else // !HAVE_GETMNTENT
string
mountpoint (string path)
{
+#if defined(__NetBSD__)
+ struct statvfs *mntbufp = 0;
+#else
struct statfs *mntbufp = 0;
+#endif
int count;
unsigned int maxmatch = 0;
unsigned int matchlen;
const char *cpath = path.c_str();
char best[PATH_MAX+1];
-
- /* From the manpage, under "BUGS" : "The memory allocated by getmntinfo() cannot be free(3)'d by the
+
+ /* From the manpage, under "BUGS" : "The memory allocated by getmntinfo() cannot be free(3)'d by the
application."
-
+
Thus: we do NOT try to free memory allocated by getmntinfo()
*/
unsigned int n = 0;
matchlen = 0;
- /* note: strcmp's semantics are not
+ /* note: strcmp's semantics are not
strict enough to use for this.
*/
}
}
}
-
+
return best;
}
#endif // HAVE_GETMNTENT
#ifdef TEST_MOUNTPOINT
-
+
main (int argc, char *argv[])
{
printf ("mp of %s = %s\n", argv[1], mountpoint (argv[1]).c_str());