about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/setenv.c5
-rw-r--r--sysdeps/posix/ttyname.c12
-rw-r--r--sysdeps/pthread/aio_misc.c7
-rw-r--r--sysdeps/unix/sysv/linux/getsysstats.c10
-rw-r--r--sysdeps/unix/sysv/linux/shm_open.c10
-rw-r--r--sysdeps/unix/sysv/linux/ttyname.c13
6 files changed, 11 insertions, 46 deletions
diff --git a/sysdeps/generic/setenv.c b/sysdeps/generic/setenv.c
index e5799e529d..e7fd49228c 100644
--- a/sysdeps/generic/setenv.c
+++ b/sysdeps/generic/setenv.c
@@ -323,8 +323,7 @@ clearenv ()
   return 0;
 }
 #ifdef _LIBC
-static void
-free_mem (void)
+libc_freeres_fn (free_mem)
 {
   /* Remove all traces.  */
   clearenv ();
@@ -333,8 +332,6 @@ free_mem (void)
   __tdestroy (known_values, free);
   known_values = NULL;
 }
-text_set_element (__libc_subfreeres, free_mem);
-
 
 # undef setenv
 # undef unsetenv
diff --git a/sysdeps/posix/ttyname.c b/sysdeps/posix/ttyname.c
index e5c3b3fbe0..b7a5d85661 100644
--- a/sysdeps/posix/ttyname.c
+++ b/sysdeps/posix/ttyname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 96, 97, 98, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,96,97,98,2000,2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,7 @@ static char *getttyname (int fd, dev_t mydev, ino_t myino,
 			 int save, int *dostat) internal_function;
 
 
-static char *getttyname_name;
+libc_freeres_ptr (static char *getttyname_name);
 
 static char *
 internal_function
@@ -134,11 +134,3 @@ ttyname (fd)
 
   return name;
 }
-
-
-static void
-free_mem (void)
-{
-  free (getttyname_name);
-}
-text_set_element (__libc_subfreeres, free_mem);
diff --git a/sysdeps/pthread/aio_misc.c b/sysdeps/pthread/aio_misc.c
index b0432e6e0e..78cf764837 100644
--- a/sysdeps/pthread/aio_misc.c
+++ b/sysdeps/pthread/aio_misc.c
@@ -530,7 +530,7 @@ handle_fildes_io (void *arg)
 						  aiocbp->aiocb64.aio_offset));
 	      else
 		aiocbp->aiocb.__return_value =
-		  TEMP_FAILURE_RETRY (pwrite (fildes, (const void *)
+		  TEMP_FAILURE_RETRY (__libc_pwrite (fildes, (const void *)
 					      aiocbp->aiocb.aio_buf,
 					      aiocbp->aiocb.aio_nbytes,
 					      aiocbp->aiocb.aio_offset));
@@ -665,9 +665,7 @@ handle_fildes_io (void *arg)
 
 
 /* Free allocated resources.  */
-static void
-__attribute__ ((unused))
-free_res (void)
+libc_freeres_fn (free_res)
 {
   size_t row;
 
@@ -676,7 +674,6 @@ free_res (void)
 
   free (pool);
 }
-text_set_element (__libc_subfreeres, free_res);
 
 
 /* Add newrequest to the runlist. The __abs_prio flag of newrequest must
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
index eaacf3727c..55ef5b661a 100644
--- a/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
@@ -38,7 +38,7 @@
 static const char path_proc[] = "/proc";
 
 /* Actual mount point of /proc filesystem.  */
-static char *mount_proc;
+libc_freeres_ptr (static char *mount_proc);
 
 /* Determine the path to the /proc filesystem if available.  */
 static const char *
@@ -319,11 +319,3 @@ __get_avphys_pages ()
   return phys_pages_info ("MemFree: %ld kB");
 }
 weak_alias (__get_avphys_pages, get_avphys_pages)
-
-
-static void
-free_mem (void)
-{
-  free (mount_proc);
-}
-text_set_element (__libc_subfreeres, free_mem);
diff --git a/sysdeps/unix/sysv/linux/shm_open.c b/sysdeps/unix/sysv/linux/shm_open.c
index a96df2427c..b118533dca 100644
--- a/sysdeps/unix/sysv/linux/shm_open.c
+++ b/sysdeps/unix/sysv/linux/shm_open.c
@@ -226,14 +226,10 @@ shm_unlink (const char *name)
 }
 
 
-static void  __attribute__ ((unused))
-freeit (void)
+/* Make sure the table is freed if we want to free everything before
+   exiting.  */
+libc_freeres_fn (freeit)
 {
   if (mountpoint.dir != defaultdir)
     free (mountpoint.dir);
 }
-
-
-/* Make sure the table is freed if we want to free everything before
-   exiting.  */
-text_set_element (__libc_subfreeres, freeit);
diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c
index f8e6e925a4..68d24f195e 100644
--- a/sysdeps/unix/sysv/linux/ttyname.c
+++ b/sysdeps/unix/sysv/linux/ttyname.c
@@ -38,7 +38,7 @@ static char *getttyname (const char *dev, dev_t mydev,
      internal_function;
 
 
-static char *getttyname_name;
+libc_freeres_ptr (static char *getttyname_name);
 
 static char *
 internal_function
@@ -103,7 +103,7 @@ getttyname (const char *dev, dev_t mydev, ino64_t myino, int save, int *dostat)
 
 
 /* Static buffer in `ttyname'.  */
-static char *ttyname_buf;
+libc_freeres_ptr (static char *ttyname_buf);
 
 
 /* Return the pathname of the terminal FD is open on, or NULL on errors.
@@ -186,12 +186,3 @@ ttyname (int fd)
 
   return name;
 }
-
-
-static void
-free_mem (void)
-{
-  free (ttyname_buf);
-  free (getttyname_name);
-}
-text_set_element (__libc_subfreeres, free_mem);