/[baselayout]/trunk/src/mountinfo.c
Gentoo

Diff of /trunk/src/mountinfo.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2603 Revision 2618
2 mountinfo.c 2 mountinfo.c
3 Obtains information about mounted filesystems. 3 Obtains information about mounted filesystems.
4 4
5 Copyright 2007 Gentoo Foundation 5 Copyright 2007 Gentoo Foundation
6 */ 6 */
7
8#define APPLET "mountinfo"
7 9
8#include <sys/types.h> 10#include <sys/types.h>
9#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 11#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
10#include <sys/param.h> 12#include <sys/param.h>
11#include <sys/ucred.h> 13#include <sys/ucred.h>
137 { "node", 0, NULL, 'n'}, 139 { "node", 0, NULL, 'n'},
138 { "reverse", 0, NULL, 'r'}, 140 { "reverse", 0, NULL, 'r'},
139 { "help", 0, NULL, 'h'}, 141 { "help", 0, NULL, 'h'},
140 { NULL, 0, NULL, 0} 142 { NULL, 0, NULL, 0}
141}; 143};
142 144#include "_usage.c"
143static void usage (int exit_status)
144{
145 int i;
146 printf ("Usage: mountinfo [options]\n\n");
147 printf ("Options:\n");
148 for (i = 0; longopts[i].name; ++i)
149 printf (" -%c, --%s\n", longopts[i].val, longopts[i].name);
150 exit (exit_status);
151}
152 145
153int main (int argc, char **argv) 146int main (int argc, char **argv)
154{ 147{
155 int i; 148 int i;
156 regex_t *fstype_regex = NULL; 149 regex_t *fstype_regex = NULL;
217 210
218 case 'r': 211 case 'r':
219 reverse = true; 212 reverse = true;
220 break; 213 break;
221 214
222 case 'h': 215 case_RC_COMMON_GETOPT
223 usage (EXIT_SUCCESS);
224
225 default:
226 usage (EXIT_FAILURE);
227 } 216 }
228 217
229 while (optind < argc) { 218 while (optind < argc) {
230 if (argv[optind][0] != '/') 219 if (argv[optind][0] != '/')
231 eerrorx ("%s: `%s' is not a mount point", argv[0], argv[optind]); 220 eerrorx ("%s: `%s' is not a mount point", argv[0], argv[optind]);

Legend:
Removed from v.2603  
changed lines
  Added in v.2618

  ViewVC Help
Powered by ViewVC 1.1.20