Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/util-linux/findfs.c

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

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 12  Line 12 
12  #include "volume_id.h"  #include "volume_id.h"
13    
14  int findfs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;  int findfs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
15  int findfs_main(int argc, char **argv)  int findfs_main(int argc UNUSED_PARAM, char **argv)
16  {  {
17   char *tmp = NULL;   char *dev = *++argv;
18    
19   if (argc != 2)   if (!dev)
20   bb_show_usage();   bb_show_usage();
21    
22   if (!strncmp(argv[1], "LABEL=", 6))   if (strncmp(dev, "/dev/", 5) == 0) {
23   tmp = get_devname_from_label(argv[1] + 6);   /* Just pass any /dev/xxx name right through.
24   else if (!strncmp(argv[1], "UUID=", 5))   * This might aid in some scripts being able
25   tmp = get_devname_from_uuid(argv[1] + 5);   * to call this unconditionally */
26   else if (!strncmp(argv[1], "/dev/", 5)) {   dev = NULL;
27   /* Just pass a device name right through.  This might aid in some scripts   } else {
28   being able to call this unconditionally */   /* Otherwise, handle LABEL=xxx and UUID=xxx,
29   tmp = argv[1];   * fail on anything else */
30   } else   if (!resolve_mount_spec(argv))
31   bb_show_usage();   bb_show_usage();
32     }
33    
34   if (tmp) {   if (*argv != dev) {
35   puts(tmp);   puts(*argv);
36   return 0;   return 0;
37   }   }
38   return 1;   return 1;

Legend:
Removed from v.983  
changed lines
  Added in v.984