misc/libphysfs/platform_macosx.c
changeset 10017 de822cd3df3a
parent 9183 4cd7c7aafea7
child 12213 bb5522e88ab2
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    36    we have to keep defining it to keep binary compatibility.
    36    we have to keep defining it to keep binary compatibility.
    37    We can't just put the libgcc version in the export list, because that
    37    We can't just put the libgcc version in the export list, because that
    38    doesn't work; once a symbol is marked as hidden, it stays that way.  */
    38    doesn't work; once a symbol is marked as hidden, it stays that way.  */
    39 
    39 
    40 void __eprintf (const char *string, const char *expression,
    40 void __eprintf (const char *string, const char *expression,
    41 	        unsigned int line, const char *filename)
    41             unsigned int line, const char *filename)
    42 {
    42 {
    43     fprintf(stderr, string, expression, line, filename);
    43     fprintf(stderr, string, expression, line, filename);
    44     fflush(stderr);
    44     fflush(stderr);
    45     abort();
    45     abort();
    46 }
    46 }
   142     int retval = 0;
   142     int retval = 0;
   143     CFTypeRef wholeMedia;
   143     CFTypeRef wholeMedia;
   144 
   144 
   145     if (!IOObjectConformsTo(service, kIOMediaClass))
   145     if (!IOObjectConformsTo(service, kIOMediaClass))
   146         return 0;
   146         return 0;
   147         
   147 
   148     wholeMedia = IORegistryEntryCreateCFProperty(service,
   148     wholeMedia = IORegistryEntryCreateCFProperty(service,
   149                                                  CFSTR(kIOMediaWholeKey),
   149                                                  CFSTR(kIOMediaWholeKey),
   150                                                  cfallocator, 0);
   150                                                  cfallocator, 0);
   151     if (wholeMedia == NULL)
   151     if (wholeMedia == NULL)
   152         return 0;
   152         return 0;
   178     if (!service)
   178     if (!service)
   179         return 0;
   179         return 0;
   180 
   180 
   181     rc = IORegistryEntryCreateIterator(service, kIOServicePlane,
   181     rc = IORegistryEntryCreateIterator(service, kIOServicePlane,
   182              kIORegistryIterateRecursively | kIORegistryIterateParents, &iter);
   182              kIORegistryIterateRecursively | kIORegistryIterateParents, &iter);
   183     
   183 
   184     if (!iter)
   184     if (!iter)
   185         return 0;
   185         return 0;
   186 
   186 
   187     if (rc != KERN_SUCCESS)
   187     if (rc != KERN_SUCCESS)
   188     {
   188     {
   202                 retval = 1;
   202                 retval = 1;
   203             } /* if */
   203             } /* if */
   204         } /* if */
   204         } /* if */
   205         IOObjectRelease(service);
   205         IOObjectRelease(service);
   206     } while ((service = IOIteratorNext(iter)) && (!retval));
   206     } while ((service = IOIteratorNext(iter)) && (!retval));
   207                 
   207 
   208     IOObjectRelease(iter);
   208     IOObjectRelease(iter);
   209     IOObjectRelease(service);
   209     IOObjectRelease(service);
   210 
   210 
   211     return retval;
   211     return retval;
   212 } /* darwinIsMountedDisc */
   212 } /* darwinIsMountedDisc */