-/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995-2019 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
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
#include <fstab.h>
#include <mntent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
#define BUFFER_SIZE 0x1fc0
struct fstab *
-getfsspec (name)
- const char *name;
+getfsspec (const char *name)
{
struct fstab_state *state;
struct mntent *m;
struct fstab *
-getfsfile (name)
- const char *name;
+getfsfile (const char *name)
{
struct fstab_state *state;
struct mntent *m;
void
-endfsent ()
+endfsent (void)
{
struct fstab_state *state;
f->fs_file = m->mnt_dir;
f->fs_vfstype = m->mnt_type;
f->fs_mntops = m->mnt_opts;
- f->fs_type = (__hasmntopt (m, FSTAB_RW) ? FSTAB_RW :
- __hasmntopt (m, FSTAB_RQ) ? FSTAB_RQ :
- __hasmntopt (m, FSTAB_RO) ? FSTAB_RO :
- __hasmntopt (m, FSTAB_SW) ? FSTAB_SW :
- __hasmntopt (m, FSTAB_XX) ? FSTAB_XX :
- "??");
+ f->fs_type = (__hasmntopt (m, FSTAB_RW) ? FSTAB_RW
+ : __hasmntopt (m, FSTAB_RQ) ? FSTAB_RQ
+ : __hasmntopt (m, FSTAB_RO) ? FSTAB_RO
+ : __hasmntopt (m, FSTAB_SW) ? FSTAB_SW
+ : __hasmntopt (m, FSTAB_XX) ? FSTAB_XX
+ : "??");
f->fs_freq = m->mnt_freq;
f->fs_passno = m->mnt_passno;
return f;
/* Make sure the memory is freed if the programs ends while in
memory-debugging mode and something actually was allocated. */
-static void
-__attribute__ ((unused))
-fstab_free (void)
+libc_freeres_fn (fstab_free)
{
char *buffer;
buffer = fstab_state.fs_buffer;
- if (buffer != NULL)
- free ((void *) buffer);
+ free ((void *) buffer);
}
-
-text_set_element (__libc_subfreeres, fstab_free);