Deleted Added
full compact
mtab_bsd.c (82794) mtab_bsd.c (119679)
1/*
1/*
2 * Copyright (c) 1997-2001 Erez Zadok
2 * Copyright (c) 1997-2003 Erez Zadok
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
10 *

--- 22 unchanged lines hidden (view full) ---

33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * %W% (Berkeley) %G%
40 *
3 * Copyright (c) 1990 Jan-Simon Pendry
4 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
5 * Copyright (c) 1990 The Regents of the University of California.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by
9 * Jan-Simon Pendry at Imperial College, London.
10 *

--- 22 unchanged lines hidden (view full) ---

33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * %W% (Berkeley) %G%
40 *
41 * $Id: mtab_bsd.c,v 1.3.2.1 2001/01/10 03:23:18 ezk Exp $
41 * $Id: mtab_bsd.c,v 1.3.2.4 2002/12/27 22:44:50 ezk Exp $
42 *
43 */
44
45/*
46 * BSD 4.4 systems don't write their mount tables on a file. Instead, they
47 * use a (better) system where the kernel keeps this state, and you access
48 * the mount tables via a known interface.
49 */

--- 9 unchanged lines hidden (view full) ---

59mnt_dup(struct statfs *mp)
60{
61 mntent_t *new_mp = ALLOC(mntent_t);
62 char *ty;
63
64 new_mp->mnt_fsname = strdup(mp->f_mntfromname);
65 new_mp->mnt_dir = strdup(mp->f_mntonname);
66
42 *
43 */
44
45/*
46 * BSD 4.4 systems don't write their mount tables on a file. Instead, they
47 * use a (better) system where the kernel keeps this state, and you access
48 * the mount tables via a known interface.
49 */

--- 9 unchanged lines hidden (view full) ---

59mnt_dup(struct statfs *mp)
60{
61 mntent_t *new_mp = ALLOC(mntent_t);
62 char *ty;
63
64 new_mp->mnt_fsname = strdup(mp->f_mntfromname);
65 new_mp->mnt_dir = strdup(mp->f_mntonname);
66
67#ifdef HAVE_FIELD_STRUCT_STATFS_F_FSTYPENAME
67#ifdef HAVE_STRUCT_STATFS_F_FSTYPENAME
68 ty = mp->f_fstypename;
68 ty = mp->f_fstypename;
69#else /* not HAVE_FIELD_STRUCT_STATFS_F_FSTYPENAME */
69#else /* not HAVE_STRUCT_STATFS_F_FSTYPENAME */
70 switch (mp->f_type) {
71
72# if defined(MOUNT_UFS) && defined(MNTTAB_TYPE_UFS)
73 case MOUNT_UFS:
74 ty = MNTTAB_TYPE_UFS;
75 break;
76# endif /* defined(MOUNT_UFS) && defined(MNTTAB_TYPE_UFS) */
77

--- 9 unchanged lines hidden (view full) ---

87 break;
88# endif /* defined(MOUNT_MFS) && defined(MNTTAB_TYPE_MFS) */
89
90 default:
91 ty = "unknown";
92
93 break;
94 }
70 switch (mp->f_type) {
71
72# if defined(MOUNT_UFS) && defined(MNTTAB_TYPE_UFS)
73 case MOUNT_UFS:
74 ty = MNTTAB_TYPE_UFS;
75 break;
76# endif /* defined(MOUNT_UFS) && defined(MNTTAB_TYPE_UFS) */
77

--- 9 unchanged lines hidden (view full) ---

87 break;
88# endif /* defined(MOUNT_MFS) && defined(MNTTAB_TYPE_MFS) */
89
90 default:
91 ty = "unknown";
92
93 break;
94 }
95#endif /* not HAVE_FIELD_STRUCT_STATFS_F_FSTYPENAME */
95#endif /* not HAVE_STRUCT_STATFS_F_FSTYPENAME */
96
97 new_mp->mnt_type = strdup(ty);
98 new_mp->mnt_opts = strdup("unset");
99 new_mp->mnt_freq = 0;
100 new_mp->mnt_passno = 0;
101
102 return new_mp;
103}

--- 42 unchanged lines hidden ---
96
97 new_mp->mnt_type = strdup(ty);
98 new_mp->mnt_opts = strdup("unset");
99 new_mp->mnt_freq = 0;
100 new_mp->mnt_passno = 0;
101
102 return new_mp;
103}

--- 42 unchanged lines hidden ---