Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 1998 09:32:36 +0100 (MET)
From:      Zoltan Sebestyen <sebesty@cs.elte.hu>
To:        FreeBSD questions mailinglist <freebsd-questions@freebsd.org>
Cc:        FreeBSD hackers mailinglist <freebsd-hackers@freebsd.org>
Subject:   Question about FreeBSD's CDROM handling capabilities
Message-ID:  <Pine.LNX.3.95.980112085852.19781A-100000@neumann.cs.elte.hu>

next in thread | raw e-mail | index | archive | help
Hi,

 I've just examing the source code of kscd, a workman based CD player for
the KDE project. In the FreeBSD/NetBSD dependent source file I found some
'ifdef' directives that are somewhat mysterious to me. They disable parts
of the code that are supposed to work on FreeBSD(at least they work on my
2.2.2-RELEASE system, and they're even necessary for the player to work
well!). Below I attached the parts of the code I mentioned. The lines
starting with an exclamation mark (!) are still in the source code, but I
think they should have to be removed.  Please tell me if with the removal
of these directives the code will be well functioning or not.

***************
*** 243,254 ****
  	}
  
  	if (ioctl(d->fd, CDIOCREADSUBCHANNEL, &sc)) {
! #ifdef __NetBSD__
  	    /* we need to release the device so the kernel will notice
  	       reloaded media */
  	    (void) close(d->fd);
  	    d->fd = -1;
! #endif
  		return (0);	/* ejected */
  	}

--- The next part ---  
***************
*** 398,407 ****
  	msf.end_f	= end % 75;
  
  	/* According to Marc van Kempen FreeBSD doesn't have CDIOCSTART -- Bernd */
! #ifndef __FreeBSD__
  	if (ioctl(d->fd, CDIOCSTART))
  		return (-1);
! #endif
  	if (ioctl(d->fd, CDIOCPLAYMSF, &msf))
  		return (-2);
  
***************
*** 427,441 ****
  	if (fstatfs(stbuf.st_rdev, &buf) == 0)
  		return (-3);
  
! #ifdef __NetBSD__
  	rval = ioctl(d->fd, CDIOCALLOW);
  	if (rval == 0)
! #endif
  	    rval = ioctl(d->fd, CDIOCEJECT);
! #ifdef __NetBSD__
  	if (rval == 0)
  	    rval = ioctl(d->fd, CDIOCPREVENT);
! #endif
  	return rval;
  }
  

--------------------------------------------------------------------------------
Sebestyen Zoltan			It all seems so stupid,
					it makes me want to give up. 
szoli@digo.inf..elte.hu			But why should I give up,
                                        when it all seems so stupid? 

					MAKE INSTALL NOT WAR





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.3.95.980112085852.19781A-100000>