From owner-svn-src-all@FreeBSD.ORG Mon Oct 26 20:33:04 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3B57106566B; Mon, 26 Oct 2009 20:33:03 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out2.tiscali.nl (smtp-out2.tiscali.nl [195.241.79.177]) by mx1.freebsd.org (Postfix) with ESMTP id 8537D8FC0C; Mon, 26 Oct 2009 20:33:03 +0000 (UTC) Received: from [212.123.145.58] (helo=sjakie.klop.ws) by smtp-out2.tiscali.nl with esmtp (Exim) (envelope-from ) id 1N2W35-0007xZ-Uj; Mon, 26 Oct 2009 21:20:16 +0100 Received: from 82-170-177-25.ip.telfort.nl (localhost [127.0.0.1]) by sjakie.klop.ws (Postfix) with ESMTP id B150F13353; Mon, 26 Oct 2009 21:20:08 +0100 (CET) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: "Colin Percival" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <200910260651.n9Q6pLfU080067@svn.freebsd.org> Date: Mon, 26 Oct 2009 21:20:08 +0100 MIME-Version: 1.0 From: "Ronald Klop" Message-ID: In-Reply-To: <200910260651.n9Q6pLfU080067@svn.freebsd.org> User-Agent: Opera Mail/10.00 (FreeBSD) Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r198477 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2009 20:33:04 -0000 I'm no committer, but isn't it nice to close the fd? Ronald. On Mon, 26 Oct 2009 07:51:21 +0100, Colin Percival = =20 wrote: > Author: cperciva > Date: Mon Oct 26 06:51:20 2009 > New Revision: 198477 > URL: http://svn.freebsd.org/changeset/base/198477 > > Log: > Eject CDROM after installation if used as source media. > Submitted by: randi > MFC after: 1 month > > Modified: > head/usr.sbin/sysinstall/cdrom.c > > Modified: head/usr.sbin/sysinstall/cdrom.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/sysinstall/cdrom.c Mon Oct 26 00:01:52 2009 (r198476) > +++ head/usr.sbin/sysinstall/cdrom.c Mon Oct 26 06:51:20 2009 (r198477) > @@ -43,6 +43,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -58,6 +59,8 @@ static Boolean previouslyMounted; /* Was > static char mountpoint[MAXPATHLEN] =3D "/dist"; > int CDROMInitQuiet; > +static void mediaEjectCDROM(Device *dev); > + > static properties > read_props(char *name) > { > @@ -218,4 +221,23 @@ mediaShutdownCDROM(Device *dev) > msgConfirm("Could not unmount the CDROM/DVD from %s: %s", mountpoint,= =20 > strerror(errno)); > else > cdromMounted =3D FALSE; > + > + mediaEjectCDROM(dev); > +} > + > +static void > +mediaEjectCDROM(Device *dev) > +{ > + int fd =3D -1; > + > + msgDebug("Ejecting CDROM/DVD at %s", dev->devname); > + > + fd =3D open(dev->devname, O_RDONLY); > +=09 > + if (fd < 0) > + msgDebug("Could not eject the CDROM/DVD from %s: %s", dev->devname, = =20 > strerror(errno)); > + else { > + ioctl(fd, CDIOCALLOW); > + ioctl(fd, CDIOCEJECT); > + } > } > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"