]> git.ozlabs.org Git - yaboot.git/blobdiff - second/file.c
Fix botched IBM patch (multiple partition handling on rs6k)
[yaboot.git] / second / file.c
index 366d5ba9dbff93cf56c7a48c1dbcbbb230802bc2..b5763a235f6d5db62ad5fb1b4c92254b89775270 100644 (file)
@@ -1,20 +1,28 @@
-/* File related stuff
-   
-   Copyright (C) 1999 Benjamin Herrenschmidt
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-   
-   This program 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 General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+/*
+ *  file.c - Filesystem related interfaces
+ *
+ *  Copyright (C) 2001, 2002 Ethan Benson
+ *
+ *  parse_device_path()
+ *
+ *  Copyright (C) 2001 Colin Walters
+ *
+ *  Copyright (C) 1999 Benjamin Herrenschmidt
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
 
 #include "ctype.h"
 #include "types.h"
@@ -158,8 +166,12 @@ file_block_open(   struct boot_file_t*     file,
                  p->part_number, p->part_start, p->part_size );
          if (partition == -1) {
               file->fs = fs_open( file, dev_name, p, file_name );
-              if (file->fs != NULL)
-                   goto bail;
+              if (file->fs == NULL || fserrorno != FILE_ERR_OK)
+                   continue;
+              else {
+                   partition = p->part_number;
+                   goto done;
+              }
          }
          if ((partition >= 0) && (partition == p->part_number))
               found = p;
@@ -175,7 +187,7 @@ file_block_open(    struct boot_file_t*     file,
      DEBUG_F( "Using OF defaults.. (found = %p)\n", found );
      file->fs = fs_open( file, dev_name, found, file_name );
 
-bail:
+done:
      if (parts)
          partitions_free(parts);