Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37569369
en ru br
ALT Linux repos
S:6.20.00-alt4
5.0: 6.16.00-alt1
4.1: 6.16.00-alt0.M41.1
4.0: 6.14.00-alt2
3.0: 6.14.00-alt1

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


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 */
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin