src/cdrom/macosx/SDL_syscdrom.c
changeset 1793 4d66375c2012
parent 1635 92947e3a18db
child 1662 782fd950bd46
child 1895 c121d94672cb
child 4159 a1b03ba2fcd0
equal deleted inserted replaced
1792:409974dedf2e 1793:4d66375c2012
   451 
   451 
   452 /* Eject the CD-ROM (Unmount the volume) */
   452 /* Eject the CD-ROM (Unmount the volume) */
   453 static int SDL_SYS_CDEject(SDL_CD *cdrom)
   453 static int SDL_SYS_CDEject(SDL_CD *cdrom)
   454 {
   454 {
   455     OSStatus err;
   455     OSStatus err;
   456 	HParamBlockRec  pb;
   456     pid_t dissenter;
   457     
   457 
   458     if (fakeCD) {
   458     if (fakeCD) {
   459         SDL_SetError (kErrorFakeDevice);
   459         SDL_SetError (kErrorFakeDevice);
   460         return -1;
   460         return -1;
   461     }
   461     }
   462     
   462     
   473     }
   473     }
   474     
   474     
   475     status = CD_STOPPED;
   475     status = CD_STOPPED;
   476     
   476     
   477 	/* Eject the volume */
   477 	/* Eject the volume */
   478 	pb.ioParam.ioNamePtr = NULL;
   478 	err = FSEjectVolumeSync(volumes[cdrom->id], kNilOptions, &dissenter);
   479 	pb.ioParam.ioVRefNum = volumes[cdrom->id];
       
   480 	err = PBUnmountVol((ParamBlockRec *) &pb);
       
   481 
   479 
   482 	if (err != noErr) {
   480 	if (err != noErr) {
   483         Unlock ();
   481         Unlock ();
   484 		SDL_SetError ("PBUnmountVol returned %d", err);
   482 		SDL_SetError ("PBUnmountVol returned %d", err);
   485 		return -4;
   483 		return -4;