ALT Linux repos
Group :: Shells
RPM: tcsh
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: tcsh-6.20.00-alt-closem-nosocket.diff
Download
Download
diff -burN tcsh-6.20.00.orig/sh.misc.c tcsh-6.20.00/sh.misc.c
--- tcsh-6.20.00.orig/sh.misc.c 2015-06-07 00:19:08.000000000 +0300
+++ tcsh-6.20.00/sh.misc.c 2017-07-20 16:09:31.517723814 +0300
@@ -257,6 +257,7 @@
closem(void)
{
int f, num_files;
+ struct stat st;
#ifdef NLS_BUGS
#ifdef NLS_CATALOGS
@@ -271,6 +272,10 @@
for (f = 0; f < num_files; f++)
if (f != SHIN && f != SHOUT && f != SHDIAG && f != OLDSTD &&
f != FSHTTY
+#ifdef S_ISSOCK
+ /* Skip sockets: tcsh never creates them */
+ && fstat(f, &st) == 0 && !S_ISSOCK(st.st_mode)
+#endif /* S_ISSOCK */
#ifdef MALLOC_TRACE
&& f != 25
#endif /* MALLOC_TRACE */