~ubuntu-branches/ubuntu/edgy/xfsprogs/edgy

« back to all changes in this revision

Viewing changes to libxfs/freebsd.c

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2005-11-16 16:32:35 UTC
  • Revision ID: james.westby@ubuntu.com-20051116163235-synnef6xjj18ny42
Tags: 2.7.7-1
* New upstream release.
* Add support for (optional) ATTR2 format extension (closes: #336350)
* Allow gcc -pedantic option for C++ <xfs.h> users (closes: #249429)
* Fix segv in xfs_db frag command (closes: #338207)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (c) 2003 Silicon Graphics, Inc.  All Rights Reserved.
3
 
 *
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify it
6
 
 * under the terms of version 2 of the GNU General Public License as
 
2
 * Copyright (c) 2003,2005 Silicon Graphics, Inc.
 
3
 * All Rights Reserved.
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License as
7
7
 * published by the Free Software Foundation.
8
8
 *
9
 
 * This program is distributed in the hope that it would be useful, but
10
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
 
 *
13
 
 * Further, this software is distributed without any warranty that it is
14
 
 * free of the rightful claim of any third person regarding infringement
15
 
 * or the like.  Any license provided herein, whether implied or
16
 
 * otherwise, applies only to this software file.  Patent licenses, if
17
 
 * any, provided herein do not apply to combinations of this program with
18
 
 * other software, or any other product whatsoever.
19
 
 *
20
 
 * You should have received a copy of the GNU General Public License along
21
 
 * with this program; if not, write the Free Software Foundation, Inc., 59
22
 
 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23
 
 *
24
 
 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
25
 
 * Mountain View, CA  94043, or:
26
 
 *
27
 
 * http://www.sgi.com
28
 
 *
29
 
 * For further information regarding this notice, see:
30
 
 *
31
 
 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
 
9
 * This program is distributed in the hope that it would be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write the Free Software Foundation,
 
16
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
32
17
 */
33
18
 
34
19
#include <xfs/libxfs.h>
54
39
 
55
40
        /* Remember, FreeBSD can now mount char devices! -- adrian */
56
41
        if (((st.st_mode & S_IFMT) != S_IFBLK) &&
57
 
            ((st.st_mode & S_IFMT) != S_IFCHR)) 
 
42
            ((st.st_mode & S_IFMT) != S_IFCHR))
58
43
                return 0;
59
44
 
60
45
        if ((cnt = getmntinfo(&fsinfo, MNT_NOWAIT)) == 0) {
67
52
        for (i = 0; i < cnt; i++) {
68
53
                if (strcmp (name, fsinfo[i].f_mntfromname) != 0)
69
54
                        continue;
70
 
                
 
55
 
71
56
                if (verbose)
72
57
                        fprintf(stderr,
73
58
                            _("%s: %s contains a mounted filesystem\n"),
93
78
        for (i = 0; i < cnt; i++) {
94
79
                if (strcmp (name, fsinfo[i].f_mntfromname) != 0)
95
80
                        continue;
96
 
                
 
81
 
97
82
                if (fsinfo[i].f_flags &= MNT_RDONLY)
98
83
                        break;
99
84
        }
144
129
                        progname, path);
145
130
                exit(1);
146
131
        }
147
 
        
 
132
 
148
133
        if (ioctl(fd, DIOCGMEDIASIZE, &size) != 0) {
149
134
                fprintf(stderr, _("%s: "
150
135
                        "DIOCGMEDIASIZE failed on \"%s\": %s\n"),
151
136
                        progname, path, strerror(errno));
152
137
                exit(1);
153
138
        }
154
 
        
 
139
 
155
140
        if (ioctl(fd, DIOCGSECTORSIZE, &ssize) != 0) {
156
141
                fprintf(stderr, _("%s: "
157
142
                        "DIOCGSECTORSIZE failed on \"%s\": %s\n"),