projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge with 3.8.3c
[gnulib.git]
/
lib
/
fsusage.c
diff --git
a/lib/fsusage.c
b/lib/fsusage.c
index
c9ed26c
..
28c54ac
100644
(file)
--- a/
lib/fsusage.c
+++ b/
lib/fsusage.c
@@
-15,6
+15,17
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+ using -I. -I will use ./config.h rather than /config.h
+ (which it would do because it found this file in ). */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
#include <sys/types.h>
#include "fsusage.h"
#include <sys/types.h>
#include "fsusage.h"
@@
-58,7
+69,7
@@
int statvfs ();
#endif
/* Return the number of TOSIZE-byte blocks used by
#endif
/* Return the number of TOSIZE-byte blocks used by
- BLOCKS FROMSIZE-byte blocks, rounding
up
. */
+ BLOCKS FROMSIZE-byte blocks, rounding
away from zero
. */
static long
adjust_blocks (blocks, fromsize, tosize)
static long
adjust_blocks (blocks, fromsize, tosize)
@@
-70,7
+81,7
@@
adjust_blocks (blocks, fromsize, tosize)
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
return blocks * (fromsize / tosize);
else /* E.g., from 256 to 512. */
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
return blocks * (fromsize / tosize);
else /* E.g., from 256 to 512. */
- return (blocks +
1
) / (tosize / fromsize);
+ return (blocks +
(blocks < 0 ? -1 : 1)
) / (tosize / fromsize);
}
/* Fill in the fields of FSP with information about space usage for
}
/* Fill in the fields of FSP with information about space usage for