about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-08-08 09:04:02 +0000
committerUlrich Drepper <drepper@redhat.com>2002-08-08 09:04:02 +0000
commitb7eb7b0f6d971568ea2d478950bd7ca18ac27d5a (patch)
tree86e7604ad0a302471cd081fd7dcf979e0c2b0f96
parent48b8e8464b5a0a4c20dca0ffac05541397bfb654 (diff)
downloadglibc-b7eb7b0f6d971568ea2d478950bd7ca18ac27d5a.tar.gz
glibc-b7eb7b0f6d971568ea2d478950bd7ca18ac27d5a.tar.xz
glibc-b7eb7b0f6d971568ea2d478950bd7ca18ac27d5a.zip
Update.
2002-08-08  Ulrich Drepper  <drepper@redhat.com>

	* gmon/gmon.c (write_gmon): Use O_NOFOLLOW in open calls if available.
-rw-r--r--ChangeLog4
-rw-r--r--gmon/gmon.c8
-rw-r--r--linuxthreads/ChangeLog4
-rw-r--r--linuxthreads/sysdeps/i386/tls.h8
4 files changed, 14 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index da4098ef38..a7a4558ee4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-08-08  Ulrich Drepper  <drepper@redhat.com>
+
+	* gmon/gmon.c (write_gmon): Use O_NOFOLLOW in open calls if available.
+
 2002-08-08  Alexandre Oliva  <aoliva@redhat.com>
 
 	* configure.in: Make the test for broken_alias_attribute stricter.
diff --git a/gmon/gmon.c b/gmon/gmon.c
index f0188a9d30..c2fcb8fd75 100644
--- a/gmon/gmon.c
+++ b/gmon/gmon.c
@@ -320,18 +320,22 @@ write_gmon (void)
     int fd = -1;
     char *env;
 
+#ifndef O_NOFOLLOW
+# define O_NOFOLLOW	0
+#endif
+
     env = getenv ("GMON_OUT_PREFIX");
     if (env != NULL && !__libc_enable_secure)
       {
 	size_t len = strlen (env);
 	char buf[len + 20];
 	sprintf (buf, "%s.%u", env, __getpid ());
-	fd = __open (buf, O_CREAT|O_TRUNC|O_WRONLY, 0666);
+	fd = __open (buf, O_CREAT|O_TRUNC|O_WRONLY|O_NOFOLLOW, 0666);
       }
 
     if (fd == -1)
       {
-	fd = __open ("gmon.out", O_CREAT|O_TRUNC|O_WRONLY, 0666);
+	fd = __open ("gmon.out", O_CREAT|O_TRUNC|O_WRONLY|O_NOFOLLOW, 0666);
 	if (fd < 0)
 	  {
 	    char buf[300];
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog
index 37dd1ad103..a6a2e9b7e1 100644
--- a/linuxthreads/ChangeLog
+++ b/linuxthreads/ChangeLog
@@ -1,3 +1,7 @@
+2002-08-08  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/i386/tls.h (TLS_DO_SET_THREAD_AREA): Removed.
+
 2002-08-07  Ulrich Drepper  <drepper@redhat.com>
 
 	* pthread.c (__linuxthreads_initial_report_events): New variable.
diff --git a/linuxthreads/sysdeps/i386/tls.h b/linuxthreads/sysdeps/i386/tls.h
index a00de6c3d8..03d36de486 100644
--- a/linuxthreads/sysdeps/i386/tls.h
+++ b/linuxthreads/sysdeps/i386/tls.h
@@ -107,14 +107,6 @@ typedef struct
   __builtin_expect (result, 0) != 0 ? -1 : nr * 8 + 7;			      \
 })
 
-#  define TLS_DO_SET_THREAD_AREA(descr)					      \
- INLINE_SYSCALL (set_thread_area, 2, descr, 1);				      \
-  if (__builtin_expect (__seg, 0) == -1)				      \
-    /* Nothing else we can do.  */					      \
-    asm ("hlt");							      \
-  __seg;								      \
-})
-
 #  ifdef __ASSUME_SET_THREAD_AREA_SYSCALL
 #   define TLS_SETUP_GS_SEGMENT(descr) \
   INLINE_SYSCALL (set_thread_area, 2, descr, 1)