rpms/coreutils/F-7 coreutils-dddoubleclose.patch, NONE, 1.1 coreutils-colorls.csh, 1.4, 1.5 coreutils-colorls.sh, 1.4, 1.5 coreutils.spec, 1.177, 1.178
Ondrej Vasik (ovasik)
fedora-extras-commits at redhat.com
Tue Mar 11 16:49:27 UTC 2008
Author: ovasik
Update of /cvs/extras/rpms/coreutils/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23410
Modified Files:
coreutils-colorls.csh coreutils-colorls.sh coreutils.spec
Added Files:
coreutils-dddoubleclose.patch
Log Message:
dd doubleclose + other way to keep user defined LS_COLORS
coreutils-dddoubleclose.patch:
--- NEW FILE coreutils-dddoubleclose.patch ---
diff -urNp coreutils-6.9-orig/src/dd.c coreutils-6.9/src/dd.c
--- coreutils-6.9-orig/src/dd.c
+++ coreutils-6.9/src/dd.c
@@ -391,6 +391,25 @@ static char const ebcdic_to_ascii[] =
'\070', '\071', '\372', '\373', '\374', '\375', '\376', '\377'
};
+/* True if we need to close the standard output *stream*. */
+static bool close_stdout_required = true;
+
+/* The only reason to close the standard output *stream* is if
+ parse_long_options fails (as it does for --help or --version).
+ In any other case, dd uses only the STDOUT_FILENO file descriptor,
+ and the "cleanup" function calls "close (STDOUT_FILENO)".
+ Closing the file descriptor and then letting the usual atexit-run
+ close_stdout function call "fclose (stdout)" would result in a
+ harmless failure of the close syscall (with errno EBADF).
+ This function serves solely to avoid the unnecessary close_stdout
+ call, once parse_long_options has succeeded. */
+static void
+maybe_close_stdout (void)
+{
+ if (close_stdout_required)
+ close_stdout ();
+}
+
void
usage (int status)
{
@@ -1639,12 +1658,14 @@ main (int argc, char **argv)
textdomain (PACKAGE);
/* Arrange to close stdout if parse_long_options exits. */
- atexit (close_stdout);
+ atexit (maybe_close_stdout);
page_size = getpagesize ();
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION,
usage, AUTHORS, (char const *) NULL);
+ close_stdout_required = false;
+
if (getopt_long (argc, argv, "", NULL, NULL) != -1)
usage (EXIT_FAILURE);
Index: coreutils-colorls.csh
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-7/coreutils-colorls.csh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- coreutils-colorls.csh 4 Mar 2008 13:41:39 -0000 1.4
+++ coreutils-colorls.csh 11 Mar 2008 16:48:56 -0000 1.5
@@ -1,7 +1,7 @@
# color-ls initialization
-if ( $?LS_COLORS ) then
- if ( "$LS_COLORS" != "" ) then
- #do not override user specified LS_COLORS and use them
+if ( $?USER_LS_COLORS ) then
+ if ( "$USER_LS_COLORS" != "" ) then
+ #When USER_LS_COLORS set, do not override user specified LS_COLORS but use them
goto finish
endif
endif
Index: coreutils-colorls.sh
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-7/coreutils-colorls.sh,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- coreutils-colorls.sh 4 Mar 2008 13:41:39 -0000 1.4
+++ coreutils-colorls.sh 11 Mar 2008 16:48:56 -0000 1.5
@@ -1,7 +1,7 @@
# color-ls initialization
-#do not override user LS_COLORS, but use them.
-if [ -z "$LS_COLORS" ]; then
+#do not override user LS_COLORS, but use them when USER_LS_COLORS is set.
+if [ -z "$USER_LS_COLORS" ]; then
alias ll='ls -l' 2>/dev/null
alias l.='ls -d .*' 2>/dev/null
Index: coreutils.spec
===================================================================
RCS file: /cvs/extras/rpms/coreutils/F-7/coreutils.spec,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -r1.177 -r1.178
--- coreutils.spec 4 Mar 2008 13:41:39 -0000 1.177
+++ coreutils.spec 11 Mar 2008 16:48:56 -0000 1.178
@@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 6.9
-Release: 7%{?dist}
+Release: 8%{?dist}
License: GPLv2+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -21,6 +21,7 @@
Patch2: coreutils-ls-x.patch
Patch3: coreutils-6.9-cp-i-u.patch
Patch4: coreutils-6.9-du-ls-upstream.patch
+Patch5: coreutils-dddoubleclose.patch
# Our patches
Patch100: coreutils-chgrp.patch
@@ -95,6 +96,7 @@
%patch2 -p1 -b .ls-x
%patch3 -p1 -b .cp-i-u
%patch4 -p1 -b .du-ls
+%patch5 -p1 -b .doubleclose
# Our patches
%patch100 -p1 -b .chgrp
@@ -285,6 +287,10 @@
/sbin/runuser
%changelog
+* Tue Mar 11 2008 Ondrej Vasik <ovasik at redhat.com> 6.9-8
+- other way to keep user defined LS_COLORS(#430827)
+- fixed harmless double close stdout in dd(#436368)
+
* Tue Mar 04 2008 Ondrej Vasik <ovasik at redhat.com> 6.9-7
- su-l/runuser-l pam file usage a bit documented(#368721)
- added several missing colored TERMS(#239266)
More information about the fedora-extras-commits
mailing list