svn commit: r203956 - user/ed/newcons/lib/libc/gen

Ed Schouten ed at FreeBSD.org
Tue Feb 16 11:33:19 UTC 2010


Author: ed
Date: Tue Feb 16 11:33:18 2010
New Revision: 203956
URL: http://svn.freebsd.org/changeset/base/203956

Log:
  Add missing volatile keywords.
  
  According to GCC, these variables may be clobbered by vfork().

Modified:
  user/ed/newcons/lib/libc/gen/popen.c
  user/ed/newcons/lib/libc/gen/posix_spawn.c

Modified: user/ed/newcons/lib/libc/gen/popen.c
==============================================================================
--- user/ed/newcons/lib/libc/gen/popen.c	Tue Feb 16 09:31:36 2010	(r203955)
+++ user/ed/newcons/lib/libc/gen/popen.c	Tue Feb 16 11:33:18 2010	(r203956)
@@ -66,12 +66,12 @@ static pthread_mutex_t pidlist_mutex = P
 #define	THREAD_UNLOCK()	if (__isthreaded) _pthread_mutex_unlock(&pidlist_mutex)
 
 FILE *
-popen(command, type)
-	const char *command, *type;
+popen(const char *command, const char * volatile type)
 {
 	struct pid *cur;
 	FILE *iop;
-	int pdes[2], pid, twoway;
+	int pdes[2], pid;
+	volatile int twoway;
 	char *argv[4];
 	struct pid *p;
 

Modified: user/ed/newcons/lib/libc/gen/posix_spawn.c
==============================================================================
--- user/ed/newcons/lib/libc/gen/posix_spawn.c	Tue Feb 16 09:31:36 2010	(r203955)
+++ user/ed/newcons/lib/libc/gen/posix_spawn.c	Tue Feb 16 11:33:18 2010	(r203956)
@@ -192,7 +192,7 @@ static int
 do_posix_spawn(pid_t *pid, const char *path,
     const posix_spawn_file_actions_t *fa,
     const posix_spawnattr_t *sa,
-    char * const argv[], char * const envp[], int use_env_path)
+    char * const argv[], char * const * volatile envp, int use_env_path)
 {
 	pid_t p;
 	volatile int error = 0;


More information about the svn-src-user mailing list