svn commit: r299234 - head/contrib/file/src

Xin LI delphij at FreeBSD.org
Sun May 8 09:30:37 UTC 2016


Author: delphij
Date: Sun May  8 09:30:36 2016
New Revision: 299234
URL: https://svnweb.freebsd.org/changeset/base/299234

Log:
  MFV r299233: Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761:
  
  Revert: Don't close stdin...
  
  This have been observed by portupgrade in its interaction with file(1),
  as reported as a regression in bin/209211.
  
  PR:		209211
  MFC after:	3 days

Modified:
  head/contrib/file/src/magic.c
Directory Properties:
  head/contrib/file/   (props changed)

Modified: head/contrib/file/src/magic.c
==============================================================================
--- head/contrib/file/src/magic.c	Sun May  8 09:27:29 2016	(r299233)
+++ head/contrib/file/src/magic.c	Sun May  8 09:30:36 2016	(r299234)
@@ -346,7 +346,7 @@ private void
 close_and_restore(const struct magic_set *ms, const char *name, int fd,
     const struct stat *sb)
 {
-	if (name == NULL)
+	if (fd == STDIN_FILENO || name == NULL)
 		return;
 	(void) close(fd);
 


More information about the svn-src-head mailing list