Compare commits

..

25 Commits

Author SHA1 Message Date
Jim Meyering
05d9a7233b *** empty log message *** 1998-01-04 23:28:28 +00:00
Jim Meyering
f664e44a2f *** empty log message *** 1998-01-04 23:27:12 +00:00
Jim Meyering
5705eaaee2 . 1998-01-04 22:54:19 +00:00
Jim Meyering
0e69432852 . 1998-01-04 22:46:40 +00:00
Jim Meyering
2d69426882 copyright 1998-01-04 22:46:23 +00:00
Jim Meyering
5d4f8ebdfd (main, usage): Check for write error to stdout before exiting.
Include "closeout.h".
1998-01-04 22:45:28 +00:00
Jim Meyering
b246280c27 (parse_long_options): Check for write error to stdout before exiting. 1998-01-04 22:43:44 +00:00
Jim Meyering
60e021ee4e (libfu_a_SOURCES): Add closeout.c.
(noinst_HEADERS): Add closeout.h.
1998-01-04 22:42:38 +00:00
Jim Meyering
63c0f480ad Use a single enumerated type, Verbosity, instead of
the two booleans, verbose and changes_only.  This fixes a bug whereby
--change had the same effect as --verbose.
Plus Paul's close_stdout changes.
1998-01-04 22:41:02 +00:00
Jim Meyering
e375f4e9c8 Use a single enumerated type, Verbosity, instead of
the two booleans, verbose and changes_only.  This fixes a bug whereby
--change had the same effect as --verbose.
1998-01-04 22:40:27 +00:00
Jim Meyering
109b9c5f94 . 1998-01-04 21:48:30 +00:00
Jim Meyering
126c1a40e5 . 1998-01-04 21:47:31 +00:00
Jim Meyering
2440fd8bac . 1998-01-03 22:53:52 +00:00
Jim Meyering
98b9c4bed7 . 1998-01-03 22:16:23 +00:00
Jim Meyering
40f708f534 . 1998-01-03 22:14:58 +00:00
Jim Meyering
ebc5dc0b0c *** empty log message *** 1998-01-03 22:13:53 +00:00
Jim Meyering
e0ed4e6a77 *** empty log message *** 1998-01-03 18:10:47 +00:00
Jim Meyering
c24393e0fd *** empty log message *** 1998-01-03 18:09:23 +00:00
Jim Meyering
e15db4ca81 *** empty log message *** 1998-01-03 16:47:35 +00:00
Jim Meyering
1059e96721 (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
just like `fsu.fsu_blocks == 0' as an indicator that usage information
is invalid.  This happens with Solaris-5.5.1 CD-ROM partitions.
1998-01-03 16:47:21 +00:00
Jim Meyering
234ea05171 *** empty log message *** 1998-01-03 14:40:33 +00:00
Jim Meyering
0fa007e352 *** empty log message *** 1998-01-03 12:03:01 +00:00
Jim Meyering
9e6b379dbf *** empty log message *** 1998-01-03 11:58:49 +00:00
Jim Meyering
d46bab3a59 Guard PARAMS-enabling definition with
`defined PROTOTYPES || (defined __STDC__ && __STDC__)' to be consistent.
1998-01-03 11:56:58 +00:00
Jim Meyering
541699c01c Guard PARAMS-enabling definition with
`defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
problems with Irix4's cc.  From Kaveh Ghazi.
1998-01-03 11:56:09 +00:00
33 changed files with 406 additions and 97 deletions

View File

@@ -10,7 +10,8 @@ EXTRA_DIST = chown.c getgroups.c getline.c lstat.c malloc.c mktime.c \
INCLUDES = -I.. -I$(srcdir) -I../intl
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
addext.c argmatch.c backupfile.c basename.c dirname.c exclude.c filemode.c \
addext.c argmatch.c backupfile.c basename.c \
closeout.c dirname.c exclude.c filemode.c \
full-write.c human.c idcache.c \
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
@@ -19,7 +20,8 @@ xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h exclude.h fnmatch.h fsusage.h \
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
error.h exclude.h fnmatch.h fsusage.h \
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
save-cwd.h savedir.h strverscmp.h xalloc.h xstrtol.h xstrtoul.h

View File

@@ -98,7 +98,8 @@ EXTRA_DIST = chown.c getgroups.c getline.c lstat.c malloc.c mktime.c \
INCLUDES = -I.. -I$(srcdir) -I../intl
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
addext.c argmatch.c backupfile.c basename.c dirname.c exclude.c filemode.c \
addext.c argmatch.c backupfile.c basename.c \
closeout.c dirname.c exclude.c filemode.c \
full-write.c human.c idcache.c \
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
@@ -107,7 +108,8 @@ xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h exclude.h fnmatch.h fsusage.h \
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
error.h exclude.h fnmatch.h fsusage.h \
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
save-cwd.h savedir.h strverscmp.h xalloc.h xstrtol.h xstrtoul.h
@@ -125,11 +127,12 @@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
ANSI2KNR = ../src/ansi2knr
libfu_a_OBJECTS = getdate$U.o posixtm$U.o getopt$U.o getopt1$U.o \
addext$U.o argmatch$U.o backupfile$U.o basename$U.o dirname$U.o \
exclude$U.o filemode$U.o full-write$U.o human$U.o idcache$U.o isdir$U.o \
long-options$U.o makepath$U.o modechange$U.o hash$U.o path-concat$U.o \
safe-read$U.o save-cwd$U.o savedir$U.o stripslash$U.o userspec$U.o \
xgetcwd$U.o xmalloc$U.o xstrdup$U.o xstrtol$U.o xstrtoul$U.o yesno$U.o
addext$U.o argmatch$U.o backupfile$U.o basename$U.o closeout$U.o \
dirname$U.o exclude$U.o filemode$U.o full-write$U.o human$U.o \
idcache$U.o isdir$U.o long-options$U.o makepath$U.o modechange$U.o \
hash$U.o path-concat$U.o safe-read$U.o save-cwd$U.o savedir$U.o \
stripslash$U.o userspec$U.o xgetcwd$U.o xmalloc$U.o xstrdup$U.o \
xstrtol$U.o xstrtoul$U.o yesno$U.o
AR = ar
YLWRAP = $(srcdir)/ylwrap
CFLAGS = @CFLAGS@
@@ -151,15 +154,15 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
.deps/backupfile.P .deps/basename.P .deps/chown.P .deps/dirname.P \
.deps/error.P .deps/euidaccess.P .deps/exclude.P .deps/fileblocks.P \
.deps/filemode.P .deps/fnmatch.P .deps/fsusage.P .deps/ftruncate.P \
.deps/full-write.P .deps/getdate.P .deps/getgroups.P .deps/getline.P \
.deps/getopt.P .deps/getopt1.P .deps/group-member.P .deps/hash.P \
.deps/human.P .deps/idcache.P .deps/isdir.P .deps/long-options.P \
.deps/lstat.P .deps/makepath.P .deps/malloc.P .deps/memcmp.P \
.deps/memcpy.P .deps/memset.P .deps/mkdir.P .deps/mktime.P \
.deps/modechange.P .deps/mountlist.P .deps/obstack.P \
.deps/backupfile.P .deps/basename.P .deps/chown.P .deps/closeout.P \
.deps/dirname.P .deps/error.P .deps/euidaccess.P .deps/exclude.P \
.deps/fileblocks.P .deps/filemode.P .deps/fnmatch.P .deps/fsusage.P \
.deps/ftruncate.P .deps/full-write.P .deps/getdate.P .deps/getgroups.P \
.deps/getline.P .deps/getopt.P .deps/getopt1.P .deps/group-member.P \
.deps/hash.P .deps/human.P .deps/idcache.P .deps/isdir.P \
.deps/long-options.P .deps/lstat.P .deps/makepath.P .deps/malloc.P \
.deps/memcmp.P .deps/memcpy.P .deps/memset.P .deps/mkdir.P \
.deps/mktime.P .deps/modechange.P .deps/mountlist.P .deps/obstack.P \
.deps/path-concat.P .deps/posixtm.P .deps/realloc.P .deps/regex.P \
.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/rx.P \
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stat.P \
@@ -233,26 +236,50 @@ libfu.a: $(libfu_a_OBJECTS) $(libfu_a_DEPENDENCIES)
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
addext_.c: addext.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` addext_.c
alloca_.c: alloca.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` alloca_.c
argmatch_.c: argmatch.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` argmatch_.c
backupfile_.c: backupfile.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` backupfile_.c
basename_.c: basename.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` basename_.c
chown_.c: chown.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` chown_.c
closeout_.c: closeout.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` closeout_.c
dirname_.c: dirname.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` dirname_.c
error_.c: error.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` error_.c
euidaccess_.c: euidaccess.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/euidaccess.c; then echo $(srcdir)/euidaccess.c; else echo euidaccess.c; fi` euidaccess_.c
exclude_.c: exclude.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` exclude_.c
fileblocks_.c: fileblocks.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` fileblocks_.c
filemode_.c: filemode.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` filemode_.c
fnmatch_.c: fnmatch.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` fnmatch_.c
fsusage_.c: fsusage.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/fsusage.c; then echo $(srcdir)/fsusage.c; else echo fsusage.c; fi` fsusage_.c
ftruncate_.c: ftruncate.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/ftruncate.c; then echo $(srcdir)/ftruncate.c; else echo ftruncate.c; fi` ftruncate_.c
full-write_.c: full-write.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/full-write.c; then echo $(srcdir)/full-write.c; else echo full-write.c; fi` full-write_.c
getdate_.c: getdate.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` getdate_.c
getgroups_.c: getgroups.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` getgroups_.c
getline_.c: getline.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` getline_.c
getopt_.c: getopt.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` getopt_.c
getopt1_.c: getopt1.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` getopt1_.c
group-member_.c: group-member.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` group-member_.c
hash_.c: hash.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` hash_.c
human_.c: human.c $(ANSI2KNR)
@@ -263,22 +290,72 @@ isdir_.c: isdir.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` isdir_.c
long-options_.c: long-options.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` long-options_.c
lstat_.c: lstat.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` lstat_.c
makepath_.c: makepath.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` makepath_.c
malloc_.c: malloc.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` malloc_.c
memcmp_.c: memcmp.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` memcmp_.c
memcpy_.c: memcpy.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` memcpy_.c
memset_.c: memset.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` memset_.c
mkdir_.c: mkdir.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/mkdir.c; then echo $(srcdir)/mkdir.c; else echo mkdir.c; fi` mkdir_.c
mktime_.c: mktime.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` mktime_.c
modechange_.c: modechange.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` modechange_.c
mountlist_.c: mountlist.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/mountlist.c; then echo $(srcdir)/mountlist.c; else echo mountlist.c; fi` mountlist_.c
obstack_.c: obstack.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` obstack_.c
path-concat_.c: path-concat.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` path-concat_.c
posixtm_.c: posixtm.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` posixtm_.c
realloc_.c: realloc.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` realloc_.c
regex_.c: regex.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` regex_.c
rename_.c: rename.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` rename_.c
rmdir_.c: rmdir.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` rmdir_.c
rpmatch_.c: rpmatch.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` rpmatch_.c
rx_.c: rx.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/rx.c; then echo $(srcdir)/rx.c; else echo rx.c; fi` rx_.c
safe-read_.c: safe-read.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` safe-read_.c
save-cwd_.c: save-cwd.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` save-cwd_.c
savedir_.c: savedir.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` savedir_.c
stat_.c: stat.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` stat_.c
stpcpy_.c: stpcpy.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` stpcpy_.c
strcasecmp_.c: strcasecmp.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` strcasecmp_.c
strdup_.c: strdup.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` strdup_.c
strftime_.c: strftime.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` strftime_.c
stripslash_.c: stripslash.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` stripslash_.c
strndup_.c: strndup.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` strndup_.c
strstr_.c: strstr.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` strstr_.c
strtol_.c: strtol.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` strtol_.c
strtoul_.c: strtoul.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` strtoul_.c
strverscmp_.c: strverscmp.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` strverscmp_.c
userspec_.c: userspec.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` userspec_.c
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
@@ -293,11 +370,17 @@ xstrtoul_.c: xstrtoul.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` xstrtoul_.c
yesno_.c: yesno.c $(ANSI2KNR)
$(ANSI2KNR) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` yesno_.c
addext_.o argmatch_.o backupfile_.o basename_.o dirname_.o exclude_.o \
filemode_.o full-write_.o getdate_.o getopt_.o getopt1_.o hash_.o \
human_.o idcache_.o isdir_.o long-options_.o makepath_.o modechange_.o \
path-concat_.o posixtm_.o safe-read_.o save-cwd_.o savedir_.o \
stripslash_.o userspec_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o \
addext_.o alloca_.o argmatch_.o backupfile_.o basename_.o chown_.o \
closeout_.o dirname_.o error_.o euidaccess_.o exclude_.o fileblocks_.o \
filemode_.o fnmatch_.o fsusage_.o ftruncate_.o full-write_.o getdate_.o \
getgroups_.o getline_.o getopt_.o getopt1_.o group-member_.o hash_.o \
human_.o idcache_.o isdir_.o long-options_.o lstat_.o makepath_.o \
malloc_.o memcmp_.o memcpy_.o memset_.o mkdir_.o mktime_.o \
modechange_.o mountlist_.o obstack_.o path-concat_.o posixtm_.o \
realloc_.o regex_.o rename_.o rmdir_.o rpmatch_.o rx_.o safe-read_.o \
save-cwd_.o savedir_.o stat_.o stpcpy_.o strcasecmp_.o strdup_.o \
strftime_.o stripslash_.o strndup_.o strstr_.o strtol_.o strtoul_.o \
strverscmp_.o userspec_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o \
xstrtoul_.o yesno_.o : $(ANSI2KNR)
tags: TAGS

60
lib/closeout.c Normal file
View File

@@ -0,0 +1,60 @@
/* closeout.c - close standard output
Copyright (C) 1998 Free Software Foundation, Inc.
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
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# define _(Text) Text
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#include <stdio.h>
#include "closeout.h"
#include "error.h"
/* Close standard output, exiting with status STATUS on failure. */
void
close_stdout_status (int status)
{
if (ferror (stdout))
error (status, 0, _("write error"));
if (fclose (stdout) != 0)
error (status, errno, _("write error"));
}
/* Close standard output, exiting with status EXIT_FAILURE on failure. */
void
close_stdout (void)
{
close_stdout_status (EXIT_FAILURE);
}

10
lib/closeout.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
void close_stdout PARAMS ((void));
void close_stdout_status PARAMS ((int status));

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1995 Free Software Foundation, Inc.
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
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
@@ -18,13 +18,13 @@
# include <config.h>
#endif
# ifndef PARAMS
# if defined (__GNUC__) || __STDC__
# define PARAMS(args) args
# else
# define PARAMS(args) ()
# endif
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(args) args
# else
# define PARAMS(args) ()
# endif
#endif
#if defined (vms)
# include <types.h>

View File

@@ -1,5 +1,5 @@
/* Utility to accept --help and --version options as unobtrusively as possible.
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1998 Free Software Foundation, Inc.
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
@@ -18,11 +18,12 @@
/* Written by Jim Meyering. */
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
#include <stdio.h>
#include <getopt.h>
#include "closeout.h"
#include "long-options.h"
static struct option const long_options[] =
@@ -62,6 +63,8 @@ parse_long_options (argc, argv, command_name, package, version, usage)
case 'v':
printf ("%s (%s) %s\n", command_name, package, version);
close_stdout (); /* FIXME: output failure exit status
should be settable via an arg. */
exit (0);
default:

View File

@@ -8,7 +8,7 @@ struct saved_cwd
};
# ifndef PARAMS
# if __STDC__
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()

View File

@@ -64,7 +64,6 @@ CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
DATADIRNAME = @DATADIRNAME@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
@@ -79,17 +78,16 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MVDIR_PROG = @MVDIR_PROG@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
POW_LIBM = @POW_LIBM@
RANLIB = @RANLIB@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
l = @l@
EXTRA_DIST = README \

View File

@@ -1,3 +1,47 @@
1998-01-04 Jim Meyering <meyering@na-net.ornl.gov>
* Version 3.16j.
* lib/Makefile.in: Regenerated with patched automake-1.2d.
See README-alpha.
* src/chgrp.c: Use a single enumerated type, Verbosity, instead of
the two booleans, verbose and changes_only. This fixes a bug whereby
--change had the same effect as --verbose.
* src/chmod.c: Likewise.
* src/chown.c: Likewise.
Reported by Paul Eggert.
1998-01-04 Paul Eggert <eggert@twinsun.com>
Check for write errors more carefully.
* lib/Makefile.am (libfu_a_SOURCES): Add closeout.c.
(noinst_HEADERS): Add closeout.h.
* lib/closeout.c, lib/closeout.h: New files.
* lib/long-options.c (parse_long_options),
src/chgrp.c, src/chmod.c, src/chown.c, src/cp.c, src/dd.c,
src/df.c, src/dircolors.c, src/du.c, src/install.c, src/ln.c,
src/ls.c, src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c,
src/mvdir.c, src/rm.c, src/rmdir.c, src/sync.c, src/touch.c
(main, usage): Check for write error to stdout before exiting.
Include "closeout.h".
1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
* src/df.c (show_dev): Treat `fsu.fsu_bavail == (unsigned long) -1'
just like `fsu.fsu_blocks == 0' as an indicator that usage information
is invalid. This happens with Solaris-5.5.1 CD-ROM mount points.
* lib/save-cwd.h: Guard PARAMS-enabling definition with
`defined PROTOTYPES || (defined __STDC__ && __STDC__)' to avoid
problems with Irix4's cc. From Kaveh Ghazi.
* lib/getdate.h: Likewise, but just to be consistent.
* configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
those files will be built via the ANSI2KNR-filtering rules if necessary.
Reported by Kaveh Ghazi.
1998-01-02 Jim Meyering <meyering@na-net.ornl.gov>
* Version 3.16i.

View File

@@ -1,5 +1,5 @@
Changes in release 3.17:
[3.16i]
[3.16j]
* du accepts new options, --exclude=PAT and --exclude-from=FILE (-X FILE)
* ls now quotes file names for the shell by default, if they contain
characters that need quoting. Use -N to get the old default behavior.
@@ -27,7 +27,7 @@ Changes in release 3.17:
* rmdir accepts new options: --ignore-fail-on-non-empty and --verbose
* on most hosts df, du, and ls now overflow at 2**64 bytes, not 2**31 bytes
* all programs now work on large files on LFS systems like Solaris 2.6 and
Linux with the pre-2.1 release of GNU libc.
Linux with the pre-2.1 development version of GNU libc.
* df now works with OpenBSD 2.1 beta
* cp -d FILE SYMLINK-TO-FILE doesn't erase FILE. Now it gives an error.

View File

@@ -1,3 +1,10 @@
1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
* lib/Makefile.am (AUTOMAKE_OPTIONS): Define to ../src/ansi2knr.
* configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
those files will be built via the ANSI2KNR-filtering rules if necessary.
1997-12-25 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in: Remove AC_DEFINE of _GNU_SOURCE.

View File

@@ -1,3 +1,10 @@
1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
* lib/Makefile.am (AUTOMAKE_OPTIONS): Define to ../src/ansi2knr.
* configure.in: Convert the .o suffix on files in LIBOBJS to $U.o so
those files will be built via the ANSI2KNR-filtering rules if necessary.
1997-12-25 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in: Remove AC_DEFINE of _GNU_SOURCE.

View File

@@ -1,5 +1,5 @@
/* chgrp -- change group ownership of files
Copyright (C) 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -25,6 +25,7 @@
#include "system.h"
#include "xstrtoul.h"
#include "closeout.h"
#include "error.h"
#include "savedir.h"
#include "group-member.h"
@@ -55,6 +56,18 @@ enum Change_status
CH_NO_CHANGE_REQUESTED
};
enum Verbosity
{
/* Print a message for each file that is processed. */
V_high,
/* Print a message for each file whose attributes we change. */
V_changes_only,
/* Do not be verbose. This is the default. */
V_off
};
static int change_dir_group PARAMS ((const char *dir, int group,
const struct stat *statp));
@@ -71,11 +84,8 @@ static int recurse;
/* If nonzero, force silence (no error messages). */
static int force_silent;
/* If nonzero, describe the files we process. */
static int verbose;
/* If nonzero, describe only owners or groups that change. */
static int changes_only;
/* Level of verbosity. */
static enum Verbosity verbosity = V_off;
/* The name of the group to which ownership of the files is being given. */
static const char *groupname;
@@ -188,7 +198,7 @@ change_file_group (const char *file, int group)
else
fail = chown (file, (uid_t) -1, group);
if (verbose || (changes_only && !fail))
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
describe_change (file, (fail ? CH_FAILED : CH_SUCCEEDED));
if (fail)
@@ -215,7 +225,7 @@ change_file_group (const char *file, int group)
}
}
}
else if (verbose && changes_only == 0)
else if (verbosity == V_high)
{
describe_change (file, CH_NO_CHANGE_REQUESTED);
}
@@ -305,6 +315,7 @@ Change the group membership of each FILE to GROUP.\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -321,7 +332,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
recurse = force_silent = verbose = changes_only = 0;
recurse = force_silent = 0;
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
{
@@ -336,8 +347,7 @@ main (int argc, char **argv)
recurse = 1;
break;
case 'c':
verbose = 1;
changes_only = 1;
verbosity = V_changes_only;
break;
case 'f':
force_silent = 1;
@@ -346,7 +356,7 @@ main (int argc, char **argv)
change_symlinks = 1;
break;
case 'v':
verbose = 1;
verbosity = V_high;
break;
default:
usage (1);
@@ -356,6 +366,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("chgrp (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -389,5 +400,7 @@ main (int argc, char **argv)
for (; optind < argc; ++optind)
errors |= change_file_group (argv[optind], group);
if (verbosity != V_off)
close_stdout ();
exit (errors);
}

View File

@@ -1,5 +1,5 @@
/* chmod -- change permission modes of files
Copyright (C) 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -24,6 +24,7 @@
#include "modechange.h"
#include "system.h"
#include "closeout.h"
#include "error.h"
#include "savedir.h"
@@ -34,6 +35,18 @@ enum Change_status
CH_NO_CHANGE_REQUESTED
};
enum Verbosity
{
/* Print a message for each file that is processed. */
V_high,
/* Print a message for each file whose attributes we change. */
V_changes_only,
/* Do not be verbose. This is the default. */
V_off
};
void mode_string ();
void strip_trailing_slashes ();
@@ -50,16 +63,13 @@ static int recurse;
/* If nonzero, force silence (no error messages). */
static int force_silent;
/* If nonzero, describe the modes we set. */
static int verbose;
/* Level of verbosity. */
static enum Verbosity verbosity = V_off;
/* The argument to the --reference option. Use the owner and group IDs
of this file. This file must exist. */
static char *reference_file;
/* If nonzero, describe only modes that change. */
static int changes_only;
/* If nonzero, display usage information and exit. */
static int show_help;
@@ -148,7 +158,7 @@ change_file_mode (const char *file, const struct mode_change *changes,
{
int fail = chmod (file, (int) newmode);
if (verbose || (changes_only && !fail))
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
describe_change (file, newmode, (fail ? CH_FAILED : CH_SUCCEEDED));
if (fail)
@@ -158,7 +168,7 @@ change_file_mode (const char *file, const struct mode_change *changes,
errors = 1;
}
}
else if (verbose && changes_only == 0)
else if (verbosity == V_high)
describe_change (file, newmode, CH_NO_CHANGE_REQUESTED);
if (recurse && S_ISDIR (file_stats.st_mode))
@@ -247,6 +257,7 @@ Each MODE is one or more of the letters ugoa, one of the symbols +-= and\n\
one or more of the letters rwxXstugo.\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -268,7 +279,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
recurse = force_silent = verbose = changes_only = 0;
recurse = force_silent = 0;
while (1)
{
@@ -307,13 +318,13 @@ main (int argc, char **argv)
recurse = 1;
break;
case 'c':
changes_only = 1;
verbosity = V_changes_only;
break;
case 'f':
force_silent = 1;
break;
case 'v':
verbose = 1;
verbosity = V_high;
break;
default:
usage (1);
@@ -323,6 +334,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("chmod (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -354,5 +366,7 @@ main (int argc, char **argv)
errors |= change_file_mode (argv[optind], changes, 1);
}
if (verbosity != V_off)
close_stdout ();
exit (errors);
}

View File

@@ -1,5 +1,5 @@
/* chown -- change user and group ownership of files
Copyright (C) 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -36,6 +36,7 @@
#include <getopt.h>
#include "system.h"
#include "closeout.h"
#include "error.h"
#include "savedir.h"
@@ -65,6 +66,18 @@ enum Change_status
CH_NO_CHANGE_REQUESTED
};
enum Verbosity
{
/* Print a message for each file that is processed. */
V_high,
/* Print a message for each file whose attributes we change. */
V_changes_only,
/* Do not be verbose. This is the default. */
V_off
};
static int change_dir_owner PARAMS ((const char *dir, uid_t user, gid_t group,
struct stat *statp));
@@ -81,11 +94,8 @@ static int recurse;
/* If nonzero, force silence (no error messages). */
static int force_silent;
/* If nonzero, describe the files we process. */
static int verbose;
/* If nonzero, describe only owners or groups that change. */
static int changes_only;
/* Level of verbosity. */
static enum Verbosity verbosity = V_off;
/* The name of the user to which ownership of the files is being given. */
static char *username;
@@ -175,7 +185,7 @@ change_file_owner (const char *file, uid_t user, gid_t group)
else
fail = chown (file, newuser, newgroup);
if (verbose || (changes_only && !fail))
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
describe_change (file, (fail ? CH_FAILED : CH_SUCCEEDED));
if (fail)
@@ -185,7 +195,7 @@ change_file_owner (const char *file, uid_t user, gid_t group)
errors = 1;
}
}
else if (verbose && changes_only == 0)
else if (verbosity == V_high)
{
describe_change (file, CH_NO_CHANGE_REQUESTED);
}
@@ -280,6 +290,7 @@ Owner is unchanged if missing. Group is unchanged if missing, but changed\n\
to login group if implied by a period. A colon may replace the period.\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -298,7 +309,7 @@ main (int argc, char **argv)
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
recurse = force_silent = verbose = changes_only = 0;
recurse = force_silent = 0;
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
{
@@ -313,8 +324,7 @@ main (int argc, char **argv)
recurse = 1;
break;
case 'c':
verbose = 1;
changes_only = 1;
verbosity = V_changes_only;
break;
case 'f':
force_silent = 1;
@@ -323,7 +333,7 @@ main (int argc, char **argv)
change_symlinks = 1;
break;
case 'v':
verbose = 1;
verbosity = V_high;
break;
default:
usage (1);
@@ -333,6 +343,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("chown (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -379,5 +390,7 @@ main (int argc, char **argv)
errors |= change_file_owner (argv[optind], user, group);
}
if (verbosity != V_off)
close_stdout ();
exit (errors);
}

View File

@@ -1,5 +1,5 @@
/* cp-hash.c -- file copying (hash search routines)
Copyright (C) 89, 90, 91, 95, 1996, 1997 Free Software Foundation.
Copyright (C) 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation.
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

View File

@@ -1,5 +1,5 @@
/* cp.c -- file copying (main routines)
Copyright (C) 89, 90, 91, 95, 1996, 1997 Free Software Foundation.
Copyright (C) 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation.
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
@@ -33,6 +33,7 @@
#include "backupfile.h"
#include "argmatch.h"
#include "path-concat.h"
#include "closeout.h"
#include "cp-hash.h"
#include "copy.h"
#include "error.h"
@@ -176,6 +177,7 @@ options are given and SOURCE and DEST are the same name for an existing,\n\
regular file.\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -728,6 +730,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("cp (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -760,5 +763,7 @@ main (int argc, char **argv)
exit_status |= do_copy (argc, argv, &x);
if (x.verbose)
close_stdout ();
exit (exit_status);
}

View File

@@ -1,5 +1,5 @@
/* dd -- convert a file while copying it.
Copyright (C) 85, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 85, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -31,6 +31,7 @@
#include "human.h"
#include "system.h"
#include "closeout.h"
#include "error.h"
#ifndef SIGINFO
@@ -351,6 +352,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("dd (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -1137,6 +1139,7 @@ by w for x2, by b for x512, by k for x1024. Each KEYWORD may be:\n\
sync pad every input block with NULs to ibs-size\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}

View File

@@ -1,5 +1,5 @@
/* df - summarize free disk space
Copyright (C) 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -32,6 +32,7 @@
#include "fsusage.h"
#include "system.h"
#include "save-cwd.h"
#include "closeout.h"
#include "error.h"
#include "human.h"
@@ -259,7 +260,7 @@ show_dev (const char *disk, const char *mount_point, const char *fstype)
double blocks_percent_used;
uintmax_t blocks_used;
if (fsu.fsu_blocks == 0)
if (fsu.fsu_blocks == 0 || fsu.fsu_bavail == (unsigned long) -1)
{
blocks_used = 0;
fsu.fsu_bavail = 0;
@@ -518,6 +519,7 @@ or all filesystems by default.\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -625,6 +627,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("df (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -716,6 +719,7 @@ with the portable output format"));
show_entry (argv[i], &stats[i - optind]);
}
close_stdout ();
exit (exit_status);
}

View File

@@ -1,6 +1,6 @@
/* dircolors - output commands to set the LS_COLOR environment variable
Copyright (C) 1994, 1995, 1997 H. Peter Anvin
Copyright (C) 96, 1997 Free Software Foundation, Inc.
Copyright (C) 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "system.h"
#include "getline.h"
#include "long-options.h"
#include "closeout.h"
#include "error.h"
#include "obstack.h"
#include "dircolors.h"
@@ -114,6 +115,7 @@ file types and extensions. Otherwise, a precompiled database is used.\n\
For details on the format of these files, run `dircolors --print-database'.\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
@@ -516,8 +518,7 @@ dircolors' internal database"));
}
}
if (fclose (stdout) == EOF)
error (EXIT_FAILURE, errno, _("write error"));
close_stdout ();
if (have_read_stdin && fclose (stdin) == EOF)
error (EXIT_FAILURE, errno, _("standard input"));

View File

@@ -1,5 +1,5 @@
/* du -- summarize disk usage
Copyright (C) 88, 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 88, 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -54,6 +54,7 @@
#include "exclude.h"
#include "system.h"
#include "save-cwd.h"
#include "closeout.h"
#include "error.h"
#include "human.h"
#include "xstrtol.h"
@@ -238,6 +239,7 @@ Summarize disk usage of each FILE, recursively for directories.\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -372,6 +374,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("du (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -405,6 +408,7 @@ main (int argc, char **argv)
du_files (optind == argc ? cwd_only : argv + optind);
close_stdout ();
exit (exit_status);
}

View File

@@ -1,5 +1,5 @@
/* install - copy files and set attributes
Copyright (C) 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -70,6 +70,7 @@
#include "backupfile.h"
#include "modechange.h"
#include "makepath.h"
#include "closeout.h"
#include "error.h"
#include "xstrtol.h"
@@ -257,6 +258,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("install (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -318,6 +320,8 @@ main (int argc, char **argv)
}
}
if (verbose)
close_stdout ();
exit (errors);
}
@@ -672,6 +676,7 @@ version control may be set with VERSION_CONTROL, values are:\n\
never, simple always make simple backups\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}

View File

@@ -1,5 +1,5 @@
/* `ln' program to create links between files.
Copyright (C) 86, 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 86, 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -28,6 +28,7 @@
#include "system.h"
#include "backupfile.h"
#include "closeout.h"
#include "error.h"
int link (); /* Some systems don't declare this anywhere. */
@@ -353,6 +354,7 @@ version control may be set with VERSION_CONTROL, values are:\n\
never, simple always make simple backups\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -429,6 +431,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("ln (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -499,5 +502,7 @@ main (int argc, char **argv)
errors += do_link (argv[optind], to);
}
if (verbose)
close_stdout ();
exit (errors != 0);
}

View File

@@ -1,5 +1,5 @@
/* `dir', `vdir' and `ls' directory listing programs for GNU.
Copyright (C) 85, 88, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 85, 88, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -65,6 +65,7 @@
#include "obstack.h"
#include "ls.h"
#include "closeout.h"
#include "error.h"
#include "human.h"
#include "argmatch.h"
@@ -698,6 +699,7 @@ main (int argc, char **argv)
(ls_mode == LS_LS ? "ls"
: (ls_mode == LS_MULTI_COL ? "dir" : "vdir")),
GNU_PACKAGE, VERSION);
close_stdout ();
exit (EXIT_SUCCESS);
}
@@ -782,9 +784,6 @@ main (int argc, char **argv)
dired_dump_obstack ("//SUBDIRED//", quoting_style, &subdired_obstack);
}
if (fclose (stdout) == EOF)
error (EXIT_FAILURE, errno, _("write error"));
/* Restore default color before exiting */
if (print_with_color)
{
@@ -792,6 +791,7 @@ main (int argc, char **argv)
put_indicator (&color_indicator[C_RIGHT]);
}
close_stdout ();
exit (exit_status);
}
@@ -2990,6 +2990,7 @@ optional WHEN argument is equivalent to using --color=always. With\n\
to a terminal (tty).\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}

View File

@@ -1,5 +1,5 @@
/* mkdir -- make directories
Copyright (C) 90, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 90, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -25,6 +25,7 @@
#include "system.h"
#include "modechange.h"
#include "makepath.h"
#include "closeout.h"
#include "error.h"
/* The name this program was run with. */
@@ -68,6 +69,7 @@ Create the DIRECTORY(ies), if they do not already exist.\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -112,6 +114,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("mkdir (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}

View File

@@ -1,5 +1,5 @@
/* mkfifo -- make fifo's (named pipes)
Copyright (C) 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -29,6 +29,7 @@
#include "system.h"
#include "modechange.h"
#include "closeout.h"
#include "error.h"
/* The name this program was run with. */
@@ -66,6 +67,7 @@ Create named pipes (FIFOs) with the given NAMEs.\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -107,6 +109,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("mkfifo (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}

View File

@@ -1,5 +1,5 @@
/* mknod -- make special files
Copyright (C) 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -34,6 +34,7 @@
#include "system.h"
#include "modechange.h"
#include "closeout.h"
#include "error.h"
#include "xstrtol.h"
@@ -77,6 +78,7 @@ MAJOR MINOR are forbidden for TYPE p, mandatory otherwise. TYPE may be:\n\
p create a FIFO\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -116,6 +118,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("mknod (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}

View File

@@ -1,5 +1,5 @@
/* mv -- move or rename files
Copyright (C) 86, 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 86, 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -49,6 +49,7 @@
#include "system.h"
#include "path-concat.h"
#include "backupfile.h"
#include "closeout.h"
#include "error.h"
#ifdef HAVE_LCHOWN
@@ -454,6 +455,7 @@ version control may be set with VERSION_CONTROL, values are:\n\
never, simple always make simple backups\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -517,6 +519,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("mv (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -545,5 +548,7 @@ main (int argc, char **argv)
for (; optind < argc - 1; ++optind)
errors |= movefile (argv[optind], argv[argc - 1], dest_is_dir);
if (verbose)
close_stdout ();
exit (errors);
}

View File

@@ -1,5 +1,5 @@
/* `rm' file deletion utility for GNU.
Copyright (C) 88, 90, 91, 94, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 88, 90, 91, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -51,6 +51,7 @@
#include "save-cwd.h"
#include "system.h"
#include "closeout.h"
#include "error.h"
#include "obstack.h"
#include "hash.h"
@@ -307,6 +308,7 @@ Remove (unlink) the FILE(s).\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -992,6 +994,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("rm (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}
@@ -1040,5 +1043,7 @@ main (int argc, char **argv)
hash_free (active_dir_map);
#endif
if (verbose)
close_stdout ();
exit (fail);
}

View File

@@ -1,5 +1,5 @@
/* rmdir -- remove directories
Copyright (C) 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include "system.h"
#include "closeout.h"
#include "error.h"
void strip_trailing_slashes ();
@@ -126,6 +127,7 @@ Remove the DIRECTORY(ies), if they are empty.\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -166,6 +168,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("rmdir (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}

View File

@@ -1,5 +1,5 @@
/* sync - update the super block
Copyright (C) 94, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -23,6 +23,7 @@
#include "system.h"
#include "long-options.h"
#include "closeout.h"
#include "error.h"
/* The name this program was run with. */
@@ -44,6 +45,7 @@ Force changed blocks to disk, update the super block.\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}

View File

@@ -1,5 +1,5 @@
/* system-dependent definitions for fileutils, textutils, and sh-utils packages.
Copyright (C) 89, 91, 92, 93, 94, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 89, 91, 92, 93, 94, 96, 97, 1998 Free Software Foundation, Inc.
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

View File

@@ -1,5 +1,5 @@
/* touch -- change modification and access times of files
Copyright (C) 87, 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
Copyright (C) 87, 89, 90, 91, 95, 96, 97, 1998 Free Software Foundation, Inc.
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
@@ -38,6 +38,7 @@
#include <sys/types.h>
#include "system.h"
#include "closeout.h"
#include "error.h"
#include "argmatch.h"
@@ -260,6 +261,7 @@ Update the access and modification times of each FILE to the current time.\n\
STAMP may be used without -t if none of -drt, nor --, are used.\n\
"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.org>."));
close_stdout ();
}
exit (status);
}
@@ -340,6 +342,7 @@ main (int argc, char **argv)
if (show_version)
{
printf ("touch (%s) %s\n", GNU_PACKAGE, VERSION);
close_stdout ();
exit (0);
}