Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37566050
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.15.00-closem.patch
Download


--- tcsh-6.15.00/sh.misc.c_old	2006-10-14 19:57:21.000000000 +0200
+++ tcsh-6.15.00/sh.misc.c	2007-08-27 15:55:20.000000000 +0200
@@ -255,6 +255,7 @@
 closem(void)
 {
     int f, num_files;
+    struct stat st;
 
 #ifdef NLS_BUGS
 #ifdef NLS_CATALOGS
@@ -272,6 +273,16 @@
 #ifdef MALLOC_TRACE
 	    && f != 25
 #endif /* MALLOC_TRACE */
+#ifdef S_ISSOCK
+           /* NSS modules (e.g. Linux nss_ldap) might keep sockets open.
+            * If we close such a socket, both the NSS module and tcsh think
+            * they "own" the descriptor.
+            *
+            * Not closing sockets does not make the cleanup use of closem()
+            * less reliable because tcsh never creates sockets.
+            */
+           && fstat(f, &st) == 0 && !S_ISSOCK(st.st_mode)
+#endif
 	    )
 	  {
 	    xclose(f);
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin