summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e96496)
raw | patch | inline | side by side (parent: 3e96496)
author | octo <octo> | |
Sun, 9 Apr 2006 12:48:14 +0000 (12:48 +0000) | ||
committer | octo <octo> | |
Sun, 9 Apr 2006 12:48:14 +0000 (12:48 +0000) |
src/utils_mount.c | patch | blob | history |
diff --git a/src/utils_mount.c b/src/utils_mount.c
index 176040aa88942016dc3584ab0b7db38ef3f03141..30a155f4d2197f5cf69e58662c8932889240a148 100644 (file)
--- a/src/utils_mount.c
+++ b/src/utils_mount.c
/* Get the number of mounted file systems */
if ((bufsize = getfsstat (NULL, 0, MNT_NOWAIT)) < 1)
+ {
+ DBG ("getfsstat failed: %s", strerror (errno));
return (NULL);
+ }
- if ((buf = (struct statfs *) malloc (bufsize * sizeof (struct statfs))) == NULL)
+ if ((buf = (struct statfs *) malloc (bufsize * sizeof (struct statfs)))
+ == NULL)
return (NULL);
memset (buf, '\0', bufsize * sizeof (struct statfs));
- /* FIXME: If `bufsize' in bytes or structures? */
- if ((num = getfsstat (buf, bufsize, MNT_NOWAIT)) < 1)
+ /* The bufsize needs to be passed in bytes. Really. This is not in the
+ * manpage.. -octo */
+ if ((num = getfsstat (buf, bufsize * sizeof (struct statfs), MNT_NOWAIT)) < 1)
{
+ DBG ("getfsstat failed: %s", strerror (errno));
free (buf);
return (NULL);
}