From 80f8bd8e8c5f610143a929dc5f9eeedb02db7aec Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 29 Mar 1993 05:09:09 +0000 Subject: merge with 3.4.1 --- lib/Makefile.in | 5 ++++- lib/dirname.c | 2 +- lib/fsusage.c | 20 ++++++++++++-------- lib/makepath.c | 4 +++- old/fileutils/ChangeLog | 45 +++++++++++++++++++++++++++++++++++++++++++-- src/cp.c | 3 +-- src/df.c | 2 +- src/ln.c | 2 +- src/ls.c | 6 +++--- src/rm.c | 4 ++-- 10 files changed, 71 insertions(+), 22 deletions(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index d441c4e3c..fb21e13dc 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 7467d29e8..5a92ce557 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 #ifndef rindex #define rindex strrchr diff --git a/lib/fsusage.c b/lib/fsusage.c index 8cc0c6d73..b43491343 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 98b78a1e6..3ca5c9765 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 +#ifndef index #define index strchr +#endif #else #include #endif diff --git a/old/fileutils/ChangeLog b/old/fileutils/ChangeLog index a7e45e682..77c3eddda 100644 --- a/old/fileutils/ChangeLog +++ b/old/fileutils/ChangeLog @@ -1,7 +1,14 @@ +Sun Mar 28 21:22:30 1993 Jim Meyering (meyering@comco.com) + + * Makefile.in (dist): Use cp when hard link fails. + Use tar-1.11.2's -z option instead of -Z. + + * makepath.c [index]: Don't redefine. + Fri Mar 26 00:32:39 1993 Jim Meyering (meyering@comco.com) - * df.c (add_omitted_fs_type, fs_to_omit): New functions adding - support for --exclude-type option. From Kaveh R. Ghazi + * df.c (add_excluded_fs_type, excluded_fs_type): New functions adding + support for --exclude-type option. Derived from Kaveh R. Ghazi . * ls.c (decode_switches, print_long_format): New option: --full-time. @@ -57,6 +64,35 @@ Wed Dec 2 12:28:10 1992 Jim Meyering (meyering@idefix.comco.com) struct option to use new macros from getopt.h: no_argument, required_argument, and optional_argument. +Tue Nov 24 07:54:45 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * system.h: Use HAVE_FCNTL_H instead of USG. + + * xgetcwd.c: Use HAVE_GETCWD instead of USG. + + * backupfile.c, basename.c, dirname.c, idcache.c, makepath.c, + mountlist.c, stripslash.c, userspec.c, xstrdup.c, system.h: + Use HAVE_STRING_H instead of USG. + + * system.h: Use SYSDIR and NDIR instead of USG. + Define direct as dirent, not vice-versa. + * ls.c, rm.c, backupfile.c, savedir.c: Use `struct dirent', + not `struct direct'. + +Thu Nov 12 23:10:56 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * system.h: If dirent is #defined, don't define direct as dirent; + for Sinix. Derived from Heinfried Korn (korn@med-in.uni-sb.de). + +Mon Nov 9 14:13:57 1992 Jim Meyering (meyering@idefix.comco.com) + + * fsusage.c (adjust_blocks): Reverse Oct 31 change -- + the function is more readable than the macro. + + * All files in src: Make all functions and extern variables static. + Make all longopts arrays const as well as static. + Make a couple statically initialized aggregates `const.' + Sat Oct 31 16:32:17 1992 Jim Meyering (meyering@idefix.comco.com) * fsusage.c (adjust_blocks): Convert to a macro. The static @@ -68,6 +104,11 @@ Sat Oct 31 16:32:17 1992 Jim Meyering (meyering@idefix.comco.com) * dd.c (swab_buffer): Fix typo that incremented pointer instead of counter. Add braces around static struct initializers. +Fri Oct 30 11:40:58 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) + + * ln.c, cp.c (main): Make -s on systems without symlinks an + error, not a warning. + Thu Oct 29 14:57:21 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) * Version 3.4. diff --git a/src/cp.c b/src/cp.c index c1415b790..9eef69c9f 100644 --- a/src/cp.c +++ b/src/cp.c @@ -220,8 +220,7 @@ main (argc, argv) #ifdef S_ISLNK flag_symbolic_link = 1; #else - error (0, 0, "symbolic links not supported; making hard links"); - flag_hard_link = 1; + error (1, 0, "symbolic links are not supported on this system"); #endif break; diff --git a/src/df.c b/src/df.c index 88f7d043d..994987f3f 100644 --- a/src/df.c +++ b/src/df.c @@ -442,7 +442,7 @@ usage () { fprintf (stderr, "\ Usage: %s [-aikPv] [-t fstype] [-x fstype] [--all] [--inodes]\n\ -\t[--type fstype] [--exclude-type fstype] [--kilobytes] [--portability]\n\ +\t[--type=fstype] [--exclude-type=fstype] [--kilobytes] [--portability]\n\ \t[path...]\n", program_name); exit (1); diff --git a/src/ln.c b/src/ln.c index ea8d3b2f3..3907399ee 100644 --- a/src/ln.c +++ b/src/ln.c @@ -122,7 +122,7 @@ main (argc, argv) #ifdef S_ISLNK symbolic_link = 1; #else - error (0, 0, "symbolic links not supported; making hard links"); + error (1, 0, "symbolic links are not supported on this system"); #endif break; case 'v': diff --git a/src/ls.c b/src/ls.c index c26b91f92..38cdd252d 100644 --- a/src/ls.c +++ b/src/ls.c @@ -214,7 +214,7 @@ enum time_type static enum time_type time_type; -/* print the full time, -T, otherwise the standard unix heuristics. */ +/* print the full time, -f, otherwise the standard unix heuristics. */ int full_time; @@ -777,7 +777,7 @@ print_dir (name, realname) char *realname; { register DIR *reading; - register struct direct *next; + register struct dirent *next; register int total_blocks = 0; errno = 0; @@ -852,7 +852,7 @@ add_ignore_pattern (pattern) static int file_interesting (next) - register struct direct *next; + register struct dirent *next; { register struct ignore_pattern *ignore; diff --git a/src/rm.c b/src/rm.c index 7e711dd99..4b6c2d2eb 100644 --- a/src/rm.c +++ b/src/rm.c @@ -134,7 +134,7 @@ main (argc, argv) if (ignore_missing_files) exit (0); else - usage (); + usage (); } stdin_tty = isatty (0); @@ -320,7 +320,7 @@ clear_directory (statp) struct stat *statp; { DIR *dirp; - struct direct *dp; + struct dirent *dp; char *name_space; /* Copy of directory's filenames. */ char *namep; /* Current entry in `name_space'. */ unsigned name_size; /* Bytes allocated for `name_space'. */ -- cgit v1.2.3-70-g09d2