aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv')
-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
3 files changed, 6 insertions, 27 deletions
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);