summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1993-03-29 05:09:24 +0000
committerJim Meyering <jim@meyering.net>1993-03-29 05:09:24 +0000
commitb06578954912a7dcfbe0c6f6efca230b04ad0e7f (patch)
tree169cb8d77de7a0337a0cbe5a0798e73fe0804952
parent642b12f91f83d4b8a06bfe3ba734e8a2afca0309 (diff)
downloadgnulib-version-3_4_2-to-fsf.tar.gz
merge with 3.4.1version-3_4_2-to-fsf
-rw-r--r--lib/Makefile.in5
-rw-r--r--lib/dirname.c2
-rw-r--r--lib/fsusage.c20
-rw-r--r--lib/makepath.c4
4 files changed, 20 insertions, 11 deletions
diff --git a/lib/Makefile.in b/lib/Makefile.in
index d441c4e3c2..fb21e13dc4 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -64,7 +64,10 @@ realclean: distclean
rm -f TAGS
dist:
- ln $(DISTFILES) ../`cat ../.fname`/lib
+ for file in $(DISTFILES); do \
+ ln $$file ../`cat ../.fname`/lib \
+ || cp $$file ../`cat ../.fname`/lib; \
+ done
libfu.a: $(OBJECTS)
rm -f $@
diff --git a/lib/dirname.c b/lib/dirname.c
index 7467d29e85..5a92ce557f 100644
--- a/lib/dirname.c
+++ b/lib/dirname.c
@@ -20,7 +20,7 @@
#else
char *malloc ();
#endif
-#if defined(USG) || defined(STDC_HEADERS)
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
#ifndef rindex
#define rindex strrchr
diff --git a/lib/fsusage.c b/lib/fsusage.c
index 8cc0c6d733..b434913439 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -56,14 +56,18 @@ int statvfs ();
/* Return the number of TOSIZE-byte blocks used by
BLOCKS FROMSIZE-byte blocks, rounding up. */
-#define adjust_blocks(blocks, fromsize, tosize) \
- (((fromsize) == (tosize)) \
- ? (blocks) /* E.g., from 512 to 512. */ \
- : (((fromsize) > (tosize)) \
- /* E.g., from 2048 to 512. */ \
- ? (blocks) * ((fromsize) / (tosize)) \
- /* E.g., from 256 to 512. */ \
- : ((blocks) + 1) / ((tosize) / (fromsize))))
+static long
+adjust_blocks (blocks, fromsize, tosize)
+ long blocks;
+ int fromsize, tosize;
+{
+ if (fromsize == tosize) /* E.g., from 512 to 512. */
+ return blocks;
+ 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);
+}
/* Fill in the fields of FSP with information about space usage for
the filesystem on which PATH resides.
diff --git a/lib/makepath.c b/lib/makepath.c
index 98b78a1e65..3ca5c97654 100644
--- a/lib/makepath.c
+++ b/lib/makepath.c
@@ -49,9 +49,11 @@ char *alloca ();
extern int errno;
#endif
-#if defined(USG) || defined(STDC_HEADERS)
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
+#ifndef index
#define index strchr
+#endif
#else
#include <strings.h>
#endif