<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-6583</id>
	<title>Nabble - freebsd-hackers</title>
	<updated>2009-11-10T15:14:02Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/freebsd-hackers-f6583.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/freebsd-hackers-f6583.html" />
	<subtitle type="html">Technical Discussions relating to FreeBSD</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26293854</id>
	<title>Converting a bootable USB stick in to bootable CD-ROM</title>
	<published>2009-11-10T15:14:02Z</published>
	<updated>2009-11-10T15:14:02Z</updated>
	<author>
		<name>PeterSteele</name>
	</author>
	<content type="html">I posted this on the -questions list but didn't get any replies. I have a FreeBSD image that I install on USB sticks to build new systems. When the stick boots it automatically clones itself on the system's hard drive, creating partitions and other configuration parameters that are programmed into the stick's cloning logic. I want to create a similar mechanism using a bootable CD-ROM. The biggest difference in the process of course is that the CD-ROM itself is read-only so clearly there needs to be an mfsroot involved in the process. I looked at how the FreeBSD Live CD is setup and the loader.conf file has these lines:
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;mfsroot_load=&amp;quot;YES&amp;quot;
&lt;br&gt;&lt;br&gt;mfsroot_type=&amp;quot;mfs_root&amp;quot;
&lt;br&gt;&lt;br&gt;mfsroot_name=&amp;quot;/boot/mfsroot&amp;quot;
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;along with the file /boot/mfsroot.gz and no /etc/fstab. The fstab on my USB stick version has root mounted as /etc/da0s1a and clearly that isn't going to work. I changed my core BSD image accordingly, duplicating the mfsroot settings in my loader.conf.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;I used the command below to create the iso file from the BSD image I prepared.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;mkisofs -R -no-emul-boot -o /tmp/bsd.iso -b boot/cdboot &amp;nbsp;/bsd
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;When this iso is copied to a CD, it does boot. However, it doesn't seem to be picking up the mfsroot config and complains that the system is running from on a read-only file system, which of course is what I'm trying to avoid.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;I assume I simply have the boot config setup wrong. I essentially want the same kind of thing that's done for BSD Live. Can anyone point me to the right info for setting up this kind of bootable BSD CD?
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26293854&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26293854&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Converting-a-bootable-USB-stick-in-to-bootable-CD-ROM-tp26293854p26293854.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26292024</id>
	<title>Alps GlidePoint driver for synaptics.</title>
	<published>2009-11-10T12:46:46Z</published>
	<updated>2009-11-10T12:46:46Z</updated>
	<author>
		<name>David DEMELIER</name>
	</author>
	<content type="html">Hello there,
&lt;br&gt;&lt;br&gt;I noticed that for the moment there is no support for alps based
&lt;br&gt;touchpads, is there anyone working on a driver for -CURRENT ? This is
&lt;br&gt;my touchpad :
&lt;br&gt;&lt;br&gt;I: Bus=0011 Vendor=0002 Product=0008 Version=7321
&lt;br&gt;N: Name=&amp;quot;AlpsPS/2 ALPS GlidePoint&amp;quot;
&lt;br&gt;P: Phys=isa0060/serio4/input0
&lt;br&gt;S: Sysfs=/devices/platform/i8042/serio4/input/input6
&lt;br&gt;U: Uniq=
&lt;br&gt;H: Handlers=mouse2 event6
&lt;br&gt;B: EV=f
&lt;br&gt;B: KEY=420 0 70000 0 0 0 0 0 0 0 0
&lt;br&gt;B: REL=3
&lt;br&gt;B: ABS=1000003
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;David.
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26292024&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26292024&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Alps-GlidePoint-driver-for-synaptics.-tp26292024p26292024.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26290577</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-10T12:24:28Z</published>
	<updated>2009-11-10T12:24:28Z</updated>
	<author>
		<name>pluknet</name>
	</author>
	<content type="html">2009/11/10 Dag-Erling Smørgrav &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290577&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;&amp;gt;:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290577&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt;&amp;gt; you're right. hundreds of functions cause segfaults when arg or args
&lt;br&gt;&amp;gt;&amp;gt; are NULL.  either we add safety checks for all of them (massive
&lt;br&gt;&amp;gt;&amp;gt; overhead) or just leave them the way they are.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The consensus in the C community is that adding such checks does more
&lt;br&gt;&amp;gt; harm than good, because a NULL pointer is usually a symptom of a bug
&lt;br&gt;&amp;gt; somewhere else in the application, and checking for a NULL pointer will
&lt;br&gt;&amp;gt; either hide that bug or trigger another error somewhere down the line,
&lt;br&gt;&amp;gt; possibly making the real bug harder to find, rather than easier.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;And which is a way some well known OS' developers like to choose to
&lt;br&gt;fix sec.holes. No cookie.
&lt;br&gt;P.S. I apologize for flaming on this.
&lt;br&gt;&lt;br&gt;&amp;gt; (next week's topic: the return value of malloc(0)...)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; DES
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Dag-Erling Smørgrav - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290577&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;wbr,
&lt;br&gt;pluknet
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290577&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290577&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26290577.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26290424</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-10T12:13:43Z</published>
	<updated>2009-11-10T12:13:43Z</updated>
	<author>
		<name>Dag-Erling Smørgrav</name>
	</author>
	<content type="html">Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290424&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt; you're right. hundreds of functions cause segfaults when arg or args
&lt;br&gt;&amp;gt; are NULL. &amp;nbsp;either we add safety checks for all of them (massive
&lt;br&gt;&amp;gt; overhead) or just leave them the way they are.
&lt;br&gt;&lt;br&gt;The consensus in the C community is that adding such checks does more
&lt;br&gt;harm than good, because a NULL pointer is usually a symptom of a bug
&lt;br&gt;somewhere else in the application, and checking for a NULL pointer will
&lt;br&gt;either hide that bug or trigger another error somewhere down the line,
&lt;br&gt;possibly making the real bug harder to find, rather than easier.
&lt;br&gt;&lt;br&gt;(next week's topic: the return value of malloc(0)...)
&lt;br&gt;&lt;br&gt;DES
&lt;br&gt;-- 
&lt;br&gt;Dag-Erling Smørgrav - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290424&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290424&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26290424&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26290424.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26289052</id>
	<title>Re: heci: a new driver for review and testing</title>
	<published>2009-11-10T10:42:26Z</published>
	<updated>2009-11-10T10:42:26Z</updated>
	<author>
		<name>Gavin Atkinson-4</name>
	</author>
	<content type="html">On Tue, 10 Nov 2009, Andriy Gapon wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; on 10/11/2009 13:54 Andriy Gapon said the following:
&lt;br&gt;&amp;gt;&amp;gt; on 09/11/2009 22:34 Gavin Atkinson said the following:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Secondly, I get a panic on module unlaod. &amp;nbsp;I haven't spent any time
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; looking at this, if you haven't fixed it yet let me know and I'll look
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; into it further.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; To my shame I still haven't got around to testing the driver with head tree and
&lt;br&gt;&amp;gt;&amp;gt; diagnostics enabled. &amp;nbsp;I do not see any problems on stable/7 without diagnostics.
&lt;br&gt;&amp;gt;&amp;gt; Robert Noland has reported that he had a lockup on module unload with head
&lt;br&gt;&amp;gt;&amp;gt; sources. &amp;nbsp;I will investigate this.
&lt;br&gt;&amp;gt;&amp;gt; BTW, 0xdeadc0dedeadc0de as arg to device_detach() looks really strange (if
&lt;br&gt;&amp;gt;&amp;gt; debugger reports it correctly). &amp;nbsp;This looks like the memory was already freed.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I think I've found one bug in the heci code that could cause this - SLIST element
&lt;br&gt;&amp;gt; was first freed and then removed from the list.
&lt;br&gt;&amp;gt; I've uploaded updated sources (that should include your PCI ID too), could you
&lt;br&gt;&amp;gt; please re-test?
&lt;/div&gt;&lt;br&gt;That seems to have fixed it, thanks! &amp;nbsp;It also fixes the malloc() calls 
&lt;br&gt;with locks held.
&lt;br&gt;&lt;br&gt;&amp;gt; Could you please send me verbose version of driver attachment messages
&lt;br&gt;&amp;gt; (debug.bootverbose=1)?
&lt;br&gt;&amp;gt; Thank you!
&lt;br&gt;&lt;br&gt;Sure!
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://people.freebsd.org/~gavin/heci-verbose.txt&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://people.freebsd.org/~gavin/heci-verbose.txt&lt;/a&gt;&lt;br&gt;&lt;br&gt;Gavin
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26289052&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26289052&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/heci%3A-a-new-driver-for-review-and-testing-tp25895296p26289052.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26287405</id>
	<title>Re: heci: a new driver for review and testing</title>
	<published>2009-11-10T09:12:48Z</published>
	<updated>2009-11-10T09:12:48Z</updated>
	<author>
		<name>Andriy Gapon</name>
	</author>
	<content type="html">on 10/11/2009 13:54 Andriy Gapon said the following:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; on 09/11/2009 22:34 Gavin Atkinson said the following:
&lt;br&gt;&amp;gt;&amp;gt; Secondly, I get a panic on module unlaod. &amp;nbsp;I haven't spent any time
&lt;br&gt;&amp;gt;&amp;gt; looking at this, if you haven't fixed it yet let me know and I'll look
&lt;br&gt;&amp;gt;&amp;gt; into it further.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; To my shame I still haven't got around to testing the driver with head tree and
&lt;br&gt;&amp;gt; diagnostics enabled. &amp;nbsp;I do not see any problems on stable/7 without diagnostics.
&lt;br&gt;&amp;gt; Robert Noland has reported that he had a lockup on module unload with head
&lt;br&gt;&amp;gt; sources. &amp;nbsp;I will investigate this.
&lt;br&gt;&amp;gt; BTW, 0xdeadc0dedeadc0de as arg to device_detach() looks really strange (if
&lt;br&gt;&amp;gt; debugger reports it correctly). &amp;nbsp;This looks like the memory was already freed.
&lt;/div&gt;&lt;br&gt;I think I've found one bug in the heci code that could cause this - SLIST element
&lt;br&gt;was first freed and then removed from the list.
&lt;br&gt;I've uploaded updated sources (that should include your PCI ID too), could you
&lt;br&gt;please re-test?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; I'm not even sure how it's getting that far into the detach routine
&lt;br&gt;&amp;gt;&amp;gt; before panicing, if dev really does = 0xdeadc0dedeadc0de
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; #8 &amp;nbsp;0xffffffff808580d3 in calltrap ()
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; at /usr/src/sys/amd64/amd64/exception.S:224
&lt;br&gt;&amp;gt;&amp;gt; #9 &amp;nbsp;0xffffffff8057ac3c in mtx_destroy (m=0xdeadc0dedeadc10e)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; at /usr/src/sys/kern/kern_mutex.c:827
&lt;br&gt;&amp;gt;&amp;gt; #10 0xffffffff812221c6 in heci_detach ()
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;from /usr/src/sys/modules/heci/heci.ko
&lt;br&gt;&amp;gt;&amp;gt; #11 0xffffffff805b44d4 in device_detach (dev=0xdeadc0dedeadc0de)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; at device_if.h:212
&lt;br&gt;&amp;gt;&amp;gt; #12 0xffffffff805b4ac0 in driver_module_handler (mod=0xffffff0002d0f800,
&lt;br&gt;&amp;gt;&amp;gt; what=Variable &amp;quot;what&amp;quot; is not available.
&lt;br&gt;&amp;gt;&amp;gt; ) at /usr/src/sys/kern/subr_bus.c:1156
&lt;br&gt;&amp;gt;&amp;gt; #13 0xffffffff80578fc5 in module_unload (mod=0xffffff0002d0f800)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; at /usr/src/sys/kern/kern_module.c:266
&lt;br&gt;&amp;gt;&amp;gt; #14 0xffffffff8056fc0b in linker_file_unload (file=0xffffff0002c9c200,
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; flags=0) at /usr/src/sys/kern/kern_linker.c:633
&lt;br&gt;&amp;gt;&amp;gt; #15 0xffffffff805707c3 in kern_kldunload (td=0xffffff0002950380,
&lt;br&gt;&amp;gt;&amp;gt; fileid=Variable &amp;quot;fileid&amp;quot; is not available.
&lt;br&gt;&amp;gt;&amp;gt; ) &amp;nbsp; &amp;nbsp;at /usr/src/sys/kern/kern_linker.c:1092
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Let me know if there's anything else I can test.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thanks,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Nothing else I can think of right now.
&lt;/div&gt;&lt;br&gt;OK, I came up with something :)
&lt;br&gt;Could you please send me verbose version of driver attachment messages
&lt;br&gt;(debug.bootverbose=1)?
&lt;br&gt;Thank you!
&lt;br&gt;&lt;br&gt;BTW, Robert, you also promised me those :)
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Andriy Gapon
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26287405&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26287405&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/heci%3A-a-new-driver-for-review-and-testing-tp25895296p26287405.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26287622</id>
	<title>RE: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-10T09:12:30Z</published>
	<updated>2009-11-10T09:12:30Z</updated>
	<author>
		<name>Matthew Fleming</name>
	</author>
	<content type="html">&amp;gt; On Tue, Nov 10, 2009 at 08:03:26AM -0800, Nate Eldredge wrote:
&lt;br&gt;&amp;gt; &amp;gt; On Tue, 10 Nov 2009, Alexander Best wrote:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;ps: would be nice if strcasecmp could protect itself from segfault
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;with one or both of the args being NULL.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I disagree. &amp;nbsp;What do you think it should do instead? &amp;nbsp;Return 0? &amp;nbsp;If
&lt;br&gt;it
&lt;br&gt;&amp;gt; &amp;gt; did, would you have found your bug?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; [snip]
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I remember System V to actually map zero page at 0, thus causing all
&lt;br&gt;&amp;gt; string functions to behave like it was supplied empty string when
&lt;br&gt;argument
&lt;br&gt;&amp;gt; is NULL. I believe Solaris still provides the library that could be
&lt;br&gt;&amp;gt; LD_PRELOADed for the same effect.
&lt;br&gt;&lt;br&gt;Just an anecdote:
&lt;br&gt;&lt;br&gt;My sophomore year of undergrad (1994), I was learning C for the first
&lt;br&gt;time. &amp;nbsp;We had to write some little thing, and on the machines in the lab
&lt;br&gt;my C program ran great; I had debugged it (I thought) and turned it in.
&lt;br&gt;&lt;br&gt;The instructor took my source, compiled it on Linux, and it segfaulted
&lt;br&gt;when run (I think trying to print a NULL string).
&lt;br&gt;&lt;br&gt;If HP-UX hadn't been trying to be &amp;quot;friendly&amp;quot; I would have been able to
&lt;br&gt;fully debug my code. &amp;nbsp;I am sure that if I'd known then what I know now I
&lt;br&gt;could have made it bug free. &amp;nbsp;But my experience is that a lot of code
&lt;br&gt;is, by necessity, written by people who aren't experts in everything
&lt;br&gt;they're doing.
&lt;br&gt;&lt;br&gt;So an early segfault would have helped me in that C programming class.
&lt;br&gt;OTOH, if instead it had been an application someone paid money for, and
&lt;br&gt;it segfaulted in an untested error case instead of being graceful, I'd
&lt;br&gt;be mad too. &amp;nbsp;Probably at the app writer, but still...
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;matthew
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26287622&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26287622&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26287622.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26287126</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-10T08:59:36Z</published>
	<updated>2009-11-10T08:59:36Z</updated>
	<author>
		<name>Kostik Belousov</name>
	</author>
	<content type="html">On Tue, Nov 10, 2009 at 08:03:26AM -0800, Nate Eldredge wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Tue, 10 Nov 2009, Alexander Best wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;ps: would be nice if strcasecmp could protect itself from segfault with 
&lt;br&gt;&amp;gt; &amp;gt;one or
&lt;br&gt;&amp;gt; &amp;gt;both of the args being NULL.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I disagree. &amp;nbsp;What do you think it should do instead? &amp;nbsp;Return 0? &amp;nbsp;If it 
&lt;br&gt;&amp;gt; did, would you have found your bug?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The same argument could be made for any of the string.h functions, but I 
&lt;br&gt;&amp;gt; don't think it actually holds water. &amp;nbsp;Such checks add overhead, and only 
&lt;br&gt;&amp;gt; provide an illusion of safety. &amp;nbsp;Sure, strcasecmp could avoid causing the 
&lt;br&gt;&amp;gt; segfault itself, but at the cost of letting a broken program continue and 
&lt;br&gt;&amp;gt; possibly cause more damage. &amp;nbsp;It could call abort(), but then you'd just 
&lt;br&gt;&amp;gt; have the same result (program terminates) with a different signal, and 
&lt;br&gt;&amp;gt; doing your check in software rather than letting the MMU hardware do it. 
&lt;br&gt;&amp;gt; It could print a message, but that pollutes the program's output, and 15 
&lt;br&gt;&amp;gt; seconds debugging the core dump will reveal the problem anyway.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Having a library function &amp;quot;protect itself&amp;quot; in this manner is not actually 
&lt;br&gt;&amp;gt; helpful, IMHO.
&lt;/div&gt;&lt;/div&gt;I remember System V to actually map zero page at 0, thus causing
&lt;br&gt;all string functions to behave like it was supplied empty string
&lt;br&gt;when argument is NULL. I believe Solaris still provides the library
&lt;br&gt;that could be LD_PRELOADed for the same effect.
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (203 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26287126/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26287126.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26286349</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-10T08:17:38Z</published>
	<updated>2009-11-10T08:17:38Z</updated>
	<author>
		<name>Alexander Best-2</name>
	</author>
	<content type="html">Nate Eldredge schrieb am 2009-11-10:
&lt;br&gt;&amp;gt; On Tue, 10 Nov 2009, Alexander Best wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;ps: would be nice if strcasecmp could protect itself from segfault
&lt;br&gt;&amp;gt; &amp;gt;with one or
&lt;br&gt;&amp;gt; &amp;gt;both of the args being NULL.
&lt;br&gt;&lt;br&gt;&amp;gt; I disagree. &amp;nbsp;What do you think it should do instead? &amp;nbsp;Return 0? &amp;nbsp;If
&lt;br&gt;&amp;gt; it did, would you have found your bug?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The same argument could be made for any of the string.h functions,
&lt;br&gt;&amp;gt; but I don't think it actually holds water. &amp;nbsp;Such checks add
&lt;br&gt;&amp;gt; overhead, and only provide an illusion of safety. &amp;nbsp;Sure, strcasecmp
&lt;br&gt;&amp;gt; could avoid causing the segfault itself, but at the cost of letting
&lt;br&gt;&amp;gt; a broken program continue and possibly cause more damage. &amp;nbsp;It could
&lt;br&gt;&amp;gt; call abort(), but then you'd just have the same result (program
&lt;br&gt;&amp;gt; terminates) with a different signal, and doing your check in
&lt;br&gt;&amp;gt; software rather than letting the MMU hardware do it. It could print
&lt;br&gt;&amp;gt; a message, but that pollutes the program's output, and 15 seconds
&lt;br&gt;&amp;gt; debugging the core dump will reveal the problem anyway.
&lt;/div&gt;&lt;br&gt;&amp;gt; Having a library function &amp;quot;protect itself&amp;quot; in this manner is not
&lt;br&gt;&amp;gt; actually helpful, IMHO.
&lt;br&gt;&lt;br&gt;&amp;gt; --
&lt;br&gt;&lt;br&gt;&amp;gt; Nate Eldredge
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26286349&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nate@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;you're right. hundreds of functions cause segfaults when arg or args are NULL.
&lt;br&gt;either we add safety checks for all of them (massive overhead) or just leave
&lt;br&gt;them the way they are. also: these functions aren't being used by regular
&lt;br&gt;users, but developers and it's hard finding a developer who isn't experienced
&lt;br&gt;with dealing with NULL pointers. ;) so problems with NULL pointers are usually
&lt;br&gt;fixed very quickly.
&lt;br&gt;&lt;br&gt;alex
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26286349&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26286349&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26286349.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26286065</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-10T08:03:26Z</published>
	<updated>2009-11-10T08:03:26Z</updated>
	<author>
		<name>Nate Eldredge-4</name>
	</author>
	<content type="html">On Tue, 10 Nov 2009, Alexander Best wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; ps: would be nice if strcasecmp could protect itself from segfault with one or
&lt;br&gt;&amp;gt; both of the args being NULL.
&lt;br&gt;&lt;br&gt;I disagree. &amp;nbsp;What do you think it should do instead? &amp;nbsp;Return 0? &amp;nbsp;If it 
&lt;br&gt;did, would you have found your bug?
&lt;br&gt;&lt;br&gt;The same argument could be made for any of the string.h functions, but I 
&lt;br&gt;don't think it actually holds water. &amp;nbsp;Such checks add overhead, and only 
&lt;br&gt;provide an illusion of safety. &amp;nbsp;Sure, strcasecmp could avoid causing the 
&lt;br&gt;segfault itself, but at the cost of letting a broken program continue and 
&lt;br&gt;possibly cause more damage. &amp;nbsp;It could call abort(), but then you'd just 
&lt;br&gt;have the same result (program terminates) with a different signal, and 
&lt;br&gt;doing your check in software rather than letting the MMU hardware do it. 
&lt;br&gt;It could print a message, but that pollutes the program's output, and 15 
&lt;br&gt;seconds debugging the core dump will reveal the problem anyway.
&lt;br&gt;&lt;br&gt;Having a library function &amp;quot;protect itself&amp;quot; in this manner is not actually 
&lt;br&gt;helpful, IMHO.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;Nate Eldredge
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26286065&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nate@...&lt;/a&gt;
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26286065&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26286065&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26286065.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26285780</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-10T07:50:07Z</published>
	<updated>2009-11-10T07:50:07Z</updated>
	<author>
		<name>Alexander Best-2</name>
	</author>
	<content type="html">Dag-Erling Smørgrav schrieb am 2009-11-10:
&lt;br&gt;&amp;gt; Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26285780&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt; &amp;gt; good point. is this one better?
&lt;br&gt;&lt;br&gt;&amp;gt; Yes (modulo indentation - run your code through tabify)
&lt;br&gt;&lt;br&gt;&amp;gt; DES
&lt;br&gt;&lt;br&gt;oops. found another problem. if BURNCD_SPEED and -s aren't defined strcasecmp
&lt;br&gt;segfaults because env_speed is NULL.
&lt;br&gt;&lt;br&gt;does this patch take care of the problem?
&lt;br&gt;&lt;br&gt;alex
&lt;br&gt;&lt;br&gt;ps: would be nice if strcasecmp could protect itself from segfault with one or
&lt;br&gt;both of the args being NULL.
&lt;br&gt;&lt;br /&gt;Index: usr.sbin/burncd/burncd.8
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.8	(revision 199125)
&lt;br&gt;+++ usr.sbin/burncd/burncd.8	(working copy)
&lt;br&gt;@@ -27,7 +27,7 @@
&lt;br&gt;&amp;nbsp;.\&amp;quot;
&lt;br&gt;&amp;nbsp;.\&amp;quot; $FreeBSD$
&lt;br&gt;&amp;nbsp;.\&amp;quot;
&lt;br&gt;-.Dd May 2, 2005
&lt;br&gt;+.Dd Nov 9, 2009
&lt;br&gt;&amp;nbsp;.Os
&lt;br&gt;&amp;nbsp;.Dt BURNCD 8
&lt;br&gt;&amp;nbsp;.Sh NAME
&lt;br&gt;@@ -158,7 +158,11 @@
&lt;br&gt;&amp;nbsp;.Sh ENVIRONMENT
&lt;br&gt;&amp;nbsp;The following environment variables affect the execution of
&lt;br&gt;&amp;nbsp;.Nm :
&lt;br&gt;-.Bl -tag -width &amp;quot;.Ev CDROM&amp;quot;
&lt;br&gt;+.Bl -tag -width &amp;quot;.Ev BURNCD_SPEED&amp;quot;
&lt;br&gt;+.It Ev BURNCD_SPEED
&lt;br&gt;+The write speed to use if one is not specified with the
&lt;br&gt;+.Fl s
&lt;br&gt;+flag.
&lt;br&gt;&amp;nbsp;.It Ev CDROM
&lt;br&gt;&amp;nbsp;The CD device to use if one is not specified with the
&lt;br&gt;&amp;nbsp;.Fl f
&lt;br&gt;Index: usr.sbin/burncd/burncd.c
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.c	(revision 199125)
&lt;br&gt;+++ usr.sbin/burncd/burncd.c	(working copy)
&lt;br&gt;@@ -80,11 +80,13 @@
&lt;br&gt;&amp;nbsp;	int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0;
&lt;br&gt;&amp;nbsp;	int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;nbsp;	int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;-	const char *dev;
&lt;br&gt;+	const char *dev, *env_speed;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;);
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;nbsp;		switch (ch) {
&lt;br&gt;&amp;nbsp;		case 'd':
&lt;br&gt;@@ -124,12 +126,7 @@
&lt;br&gt;&amp;nbsp;			break;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;		case 's':
&lt;br&gt;-			if (strcasecmp(&amp;quot;max&amp;quot;, optarg) == 0)
&lt;br&gt;-				speed = CDR_MAX_SPEED;
&lt;br&gt;-			else
&lt;br&gt;-				speed = atoi(optarg) * 177;
&lt;br&gt;-			if (speed &amp;lt;= 0)
&lt;br&gt;-				errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, optarg);
&lt;br&gt;+			env_speed = optarg;
&lt;br&gt;&amp;nbsp;			break;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;		case 't':
&lt;br&gt;@@ -147,6 +144,15 @@
&lt;br&gt;&amp;nbsp;	argc -= optind;
&lt;br&gt;&amp;nbsp;	argv += optind;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	if (env_speed == NULL)
&lt;br&gt;+		;
&lt;br&gt;+	else if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;+		speed = CDR_MAX_SPEED;
&lt;br&gt;+	else
&lt;br&gt;+		speed = atoi(env_speed) * 177;
&lt;br&gt;+	if (speed &amp;lt;= 0)
&lt;br&gt;+		errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, optarg);
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	if (argc == 0)
&lt;br&gt;&amp;nbsp;		usage();
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26285780&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26285780&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26285780.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26282157</id>
	<title>Re: heci: a new driver for review and testing</title>
	<published>2009-11-10T03:54:09Z</published>
	<updated>2009-11-10T03:54:09Z</updated>
	<author>
		<name>Andriy Gapon</name>
	</author>
	<content type="html">on 09/11/2009 22:34 Gavin Atkinson said the following:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, 14 Oct 2009, Andriy Gapon wrote:
&lt;br&gt;&amp;gt;&amp;gt; Some time ago I posted some ideas about HECI/MEI driver for FreeBSD:
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://docs.freebsd.org/cgi/mid.cgi?4968E9A1.3080006&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://docs.freebsd.org/cgi/mid.cgi?4968E9A1.3080006&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I actually got around to implementing it (in initial/basic form):
&lt;br&gt;&amp;gt;&amp;gt; &lt;a href=&quot;http://people.freebsd.org/~avg/heci.tgz&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://people.freebsd.org/~avg/heci.tgz&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Nice!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I've got the following device in my laptop:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; heci0@pci0:0:3:0: &amp;nbsp; &amp;nbsp; &amp;nbsp; class=0x078000 card=0x00011179 chip=0x2a448086
&lt;br&gt;&amp;gt; rev=0x07 hdr=0x00
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; vendor &amp;nbsp; &amp;nbsp; = 'Intel Corporation'
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; device &amp;nbsp; &amp;nbsp; = 'Intel Management Engine Interface (Mobile 4 Series
&lt;br&gt;&amp;gt; Chipset)'
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; class &amp;nbsp; &amp;nbsp; &amp;nbsp;= simple comms
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I've added this device to the code, and loaded it:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; heci0: &amp;lt;Intel ICH9 (Cantiga) Express HECI/MEI Controller&amp;gt; mem
&lt;br&gt;&amp;gt; 0xff9ffff0-0xff9fffff irq 16 at device 3.0 on pci0
&lt;/div&gt;&lt;br&gt;I will add this ID and name to the driver.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; heci0: using MSI
&lt;br&gt;&amp;gt; heci0: [ITHREAD]
&lt;br&gt;&amp;gt; heci0: found ME client at address 0x02:
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; status = 0x00
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; protocol_name(guid) = BB875E12-CB58-4D14-AE93-8566183C66C7
&lt;br&gt;&amp;gt; heci0: found ME client at address 0x06:
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; status = 0x00
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; protocol_name(guid) = 9B27FD6D-EF72-4967-BCC2-471A32679620
&lt;br&gt;&amp;gt; heci0: found ME client at address 0x07:
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; status = 0x00
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; protocol_name(guid) = 55213584-9A29-4916-BADF-0FB7ED682AEB
&lt;br&gt;&amp;gt; heci0: found ME client at address 0x20:
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; status = 0x00
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; protocol_name(guid) = 309DCDE8-CCB1-4062-8F78-600115A34327
&lt;br&gt;&amp;gt; heci0: found ME client at address 0x21:
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; status = 0x00
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; protocol_name(guid) = 23F27E9B-9D26-4FCE-9227-DE06446E5B06
&lt;br&gt;&amp;gt; heci0: found ME client at address 0x22:
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; status = 0x00
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; protocol_name(guid) = 6733A4DB-0476-4E7B-B3AF-BCFC29BEE7A7
&lt;br&gt;&amp;gt; heci0: found ME client at address 0x23:
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; status = 0x00
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; protocol_name(guid) = 12F80028-B4B7-4B2D-ACA8-46E0FF65814C
&lt;br&gt;&amp;gt; heci0: found ME client at address 0x24:
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; status = 0x00
&lt;br&gt;&amp;gt; heci0: &amp;nbsp; &amp;nbsp; protocol_name(guid) = 05B79A6F-4628-4D7F-899D-A91514CB32AB
&lt;/div&gt;&lt;br&gt;Thanks a lot for testing!
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; However, running the heci-qst.c program you supplied:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; psi# ./heci-qst
&lt;br&gt;&amp;gt; ioctl HECI_CONNECT: No such file or directory
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; And output to the console:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; heci0: could not find ME client with given guid:
&lt;br&gt;&amp;gt; 6B5205B9-8185-4519-B889-D98724B58607
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Other than seeing that it doesn't appear in the list above, I don't know
&lt;br&gt;&amp;gt; if this is expected or not...
&lt;/div&gt;&lt;br&gt;Yes, this is expected if you don't have ME client with this GUID.
&lt;br&gt;Perhaps, there is no QST firmware in the ME or it is disabled. &amp;nbsp;Also, I am not
&lt;br&gt;sure but I think that it could be possible that you have a newer version of QST
&lt;br&gt;and its GUID is different. &amp;nbsp;If you feel adventurous, you could try substituting
&lt;br&gt;GUID value in heci-qst.c with values reported by the driver. &amp;nbsp;Perhaps it would
&lt;br&gt;work, perhaps you'd get a crash or hang or just an ioctl error.
&lt;br&gt;&lt;br&gt;&amp;gt; Secondly, I get a panic on module unlaod. &amp;nbsp;I haven't spent any time
&lt;br&gt;&amp;gt; looking at this, if you haven't fixed it yet let me know and I'll look
&lt;br&gt;&amp;gt; into it further.
&lt;br&gt;&lt;br&gt;To my shame I still haven't got around to testing the driver with head tree and
&lt;br&gt;diagnostics enabled. &amp;nbsp;I do not see any problems on stable/7 without diagnostics.
&lt;br&gt;Robert Noland has reported that he had a lockup on module unload with head
&lt;br&gt;sources. &amp;nbsp;I will investigate this.
&lt;br&gt;BTW, 0xdeadc0dedeadc0de as arg to device_detach() looks really strange (if
&lt;br&gt;debugger reports it correctly). &amp;nbsp;This looks like the memory was already freed.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I'm not even sure how it's getting that far into the detach routine
&lt;br&gt;&amp;gt; before panicing, if dev really does = 0xdeadc0dedeadc0de
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; #8 &amp;nbsp;0xffffffff808580d3 in calltrap ()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at /usr/src/sys/amd64/amd64/exception.S:224
&lt;br&gt;&amp;gt; #9 &amp;nbsp;0xffffffff8057ac3c in mtx_destroy (m=0xdeadc0dedeadc10e)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at /usr/src/sys/kern/kern_mutex.c:827
&lt;br&gt;&amp;gt; #10 0xffffffff812221c6 in heci_detach ()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;from /usr/src/sys/modules/heci/heci.ko
&lt;br&gt;&amp;gt; #11 0xffffffff805b44d4 in device_detach (dev=0xdeadc0dedeadc0de)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at device_if.h:212
&lt;br&gt;&amp;gt; #12 0xffffffff805b4ac0 in driver_module_handler (mod=0xffffff0002d0f800,
&lt;br&gt;&amp;gt; what=Variable &amp;quot;what&amp;quot; is not available.
&lt;br&gt;&amp;gt; ) at /usr/src/sys/kern/subr_bus.c:1156
&lt;br&gt;&amp;gt; #13 0xffffffff80578fc5 in module_unload (mod=0xffffff0002d0f800)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; at /usr/src/sys/kern/kern_module.c:266
&lt;br&gt;&amp;gt; #14 0xffffffff8056fc0b in linker_file_unload (file=0xffffff0002c9c200,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; flags=0) at /usr/src/sys/kern/kern_linker.c:633
&lt;br&gt;&amp;gt; #15 0xffffffff805707c3 in kern_kldunload (td=0xffffff0002950380,
&lt;br&gt;&amp;gt; fileid=Variable &amp;quot;fileid&amp;quot; is not available.
&lt;br&gt;&amp;gt; ) &amp;nbsp; &amp;nbsp;at /usr/src/sys/kern/kern_linker.c:1092
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Let me know if there's anything else I can test.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks,
&lt;/div&gt;&lt;br&gt;Nothing else I can think of right now.
&lt;br&gt;Thanks again!
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Andriy Gapon
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26282157&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26282157&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/heci%3A-a-new-driver-for-review-and-testing-tp25895296p26282157.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26279636</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-10T00:00:29Z</published>
	<updated>2009-11-10T00:00:29Z</updated>
	<author>
		<name>Dag-Erling Smørgrav</name>
	</author>
	<content type="html">Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26279636&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt; good point. is this one better?
&lt;br&gt;&lt;br&gt;Yes (modulo indentation - run your code through tabify)
&lt;br&gt;&lt;br&gt;DES
&lt;br&gt;-- 
&lt;br&gt;Dag-Erling Smørgrav - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26279636&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26279636&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26279636&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26279636.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26273777</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T13:11:25Z</published>
	<updated>2009-11-09T13:11:25Z</updated>
	<author>
		<name>Alexander Best-2</name>
	</author>
	<content type="html">Dag-Erling Smørgrav schrieb am 2009-11-09:
&lt;br&gt;&amp;gt; Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273777&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; if ((env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;)) != NULL) {
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speed = CDR_MAX_SPEED;
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speed = atoi(env_speed) * 177;
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (speed &amp;lt;= 0)
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;,
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; env_speed);
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;gt; +
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (ch) {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 'd':
&lt;/div&gt;&lt;br&gt;&amp;gt; You realize you're duplicating 6 lines of non-trivial code for no
&lt;br&gt;&amp;gt; good
&lt;br&gt;&amp;gt; reason?
&lt;/div&gt;&lt;br&gt;&amp;gt; env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;);
&lt;br&gt;&lt;br&gt;&amp;gt; while ((ch = getopt(...)) != -1) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; switch (ch) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; case 's':
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; env_speed = optarg;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&lt;br&gt;&amp;gt; if (env_speed != NULL) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; if (strcasecmp...) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; }
&lt;br&gt;&lt;br&gt;&amp;gt; DES
&lt;br&gt;&lt;br&gt;good point. is this one better?
&lt;br&gt;&lt;br&gt;alex
&lt;br&gt;&lt;br /&gt;Index: usr.sbin/burncd/burncd.8
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.8	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.8	(working copy)
&lt;br&gt;@@ -27,7 +27,7 @@
&lt;br&gt;&amp;nbsp;.\&amp;quot;
&lt;br&gt;&amp;nbsp;.\&amp;quot; $FreeBSD$
&lt;br&gt;&amp;nbsp;.\&amp;quot;
&lt;br&gt;-.Dd May 2, 2005
&lt;br&gt;+.Dd Nov 9, 2009
&lt;br&gt;&amp;nbsp;.Os
&lt;br&gt;&amp;nbsp;.Dt BURNCD 8
&lt;br&gt;&amp;nbsp;.Sh NAME
&lt;br&gt;@@ -158,7 +158,11 @@
&lt;br&gt;&amp;nbsp;.Sh ENVIRONMENT
&lt;br&gt;&amp;nbsp;The following environment variables affect the execution of
&lt;br&gt;&amp;nbsp;.Nm :
&lt;br&gt;-.Bl -tag -width &amp;quot;.Ev CDROM&amp;quot;
&lt;br&gt;+.Bl -tag -width &amp;quot;.Ev BURNCD_SPEED&amp;quot;
&lt;br&gt;+.It Ev BURNCD_SPEED
&lt;br&gt;+The write speed to use if one is not specified with the
&lt;br&gt;+.Fl s
&lt;br&gt;+flag.
&lt;br&gt;&amp;nbsp;.It Ev CDROM
&lt;br&gt;&amp;nbsp;The CD device to use if one is not specified with the
&lt;br&gt;&amp;nbsp;.Fl f
&lt;br&gt;Index: usr.sbin/burncd/burncd.c
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.c	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.c	(working copy)
&lt;br&gt;@@ -80,11 +80,13 @@
&lt;br&gt;&amp;nbsp;	int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0;
&lt;br&gt;&amp;nbsp;	int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;nbsp;	int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;-	const char *dev;
&lt;br&gt;+	const char *dev, *env_speed;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;);
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;nbsp;		switch (ch) {
&lt;br&gt;&amp;nbsp;		case 'd':
&lt;br&gt;@@ -124,12 +126,7 @@
&lt;br&gt;&amp;nbsp;			break;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;		case 's':
&lt;br&gt;-			if (strcasecmp(&amp;quot;max&amp;quot;, optarg) == 0)
&lt;br&gt;-				speed = CDR_MAX_SPEED;
&lt;br&gt;-			else
&lt;br&gt;-				speed = atoi(optarg) * 177;
&lt;br&gt;-			if (speed &amp;lt;= 0)
&lt;br&gt;-				errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, optarg);
&lt;br&gt;+			env_speed = optarg;
&lt;br&gt;&amp;nbsp;			break;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;		case 't':
&lt;br&gt;@@ -147,6 +144,13 @@
&lt;br&gt;&amp;nbsp;	argc -= optind;
&lt;br&gt;&amp;nbsp;	argv += optind;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;+		 speed = CDR_MAX_SPEED;
&lt;br&gt;+	else
&lt;br&gt;+		speed = atoi(env_speed) * 177;
&lt;br&gt;+	if (speed &amp;lt;= 0)
&lt;br&gt;+		errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, optarg);
&lt;br&gt;+		
&lt;br&gt;&amp;nbsp;	if (argc == 0)
&lt;br&gt;&amp;nbsp;		usage();
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273777&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273777&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26273777.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26273575</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T12:58:21Z</published>
	<updated>2009-11-09T12:58:21Z</updated>
	<author>
		<name>Dag-Erling Smørgrav</name>
	</author>
	<content type="html">Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273575&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; writes:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; +	if ((env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;)) != NULL) {
&lt;br&gt;&amp;gt; +		if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;&amp;gt; +			speed = CDR_MAX_SPEED;
&lt;br&gt;&amp;gt; +		else
&lt;br&gt;&amp;gt; +			speed = atoi(env_speed) * 177;
&lt;br&gt;&amp;gt; +		if (speed &amp;lt;= 0)
&lt;br&gt;&amp;gt; +			errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, env_speed);
&lt;br&gt;&amp;gt; +	}
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt; &amp;nbsp;	while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;gt; &amp;nbsp;		switch (ch) {
&lt;br&gt;&amp;gt; &amp;nbsp;		case 'd':
&lt;/div&gt;&lt;br&gt;You realize you're duplicating 6 lines of non-trivial code for no good
&lt;br&gt;reason?
&lt;br&gt;&lt;br&gt;env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;);
&lt;br&gt;&lt;br&gt;while ((ch = getopt(...)) != -1) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; switch (ch) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; case 's':
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; env_speed = optarg;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;
&lt;br&gt;&amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;if (env_speed != NULL) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; if (strcasecmp...) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;&amp;nbsp; &amp;nbsp; }
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;DES
&lt;br&gt;-- 
&lt;br&gt;Dag-Erling Smørgrav - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273575&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273575&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273575&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26273575.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26273682</id>
	<title>Re: heci: a new driver for review and testing</title>
	<published>2009-11-09T12:34:09Z</published>
	<updated>2009-11-09T12:34:09Z</updated>
	<author>
		<name>Gavin Atkinson-4</name>
	</author>
	<content type="html">On Wed, 14 Oct 2009, Andriy Gapon wrote:
&lt;br&gt;&amp;gt; Some time ago I posted some ideas about HECI/MEI driver for FreeBSD:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://docs.freebsd.org/cgi/mid.cgi?4968E9A1.3080006&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://docs.freebsd.org/cgi/mid.cgi?4968E9A1.3080006&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I actually got around to implementing it (in initial/basic form):
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://people.freebsd.org/~avg/heci.tgz&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://people.freebsd.org/~avg/heci.tgz&lt;/a&gt;&lt;br&gt;&lt;br&gt;Nice!
&lt;br&gt;&lt;br&gt;I've got the following device in my laptop:
&lt;br&gt;&lt;br&gt;heci0@pci0:0:3:0: &amp;nbsp; &amp;nbsp; &amp;nbsp; class=0x078000 card=0x00011179 chip=0x2a448086 rev=0x07 hdr=0x00
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;vendor &amp;nbsp; &amp;nbsp; = 'Intel Corporation'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;device &amp;nbsp; &amp;nbsp; = 'Intel Management Engine Interface (Mobile 4 Series Chipset)'
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;class &amp;nbsp; &amp;nbsp; &amp;nbsp;= simple comms
&lt;br&gt;&lt;br&gt;I've added this device to the code, and loaded it:
&lt;br&gt;&lt;br&gt;heci0: &amp;lt;Intel ICH9 (Cantiga) Express HECI/MEI Controller&amp;gt; mem 0xff9ffff0-0xff9fffff irq 16 at device 3.0 on pci0
&lt;br&gt;heci0: using MSI
&lt;br&gt;heci0: [ITHREAD]
&lt;br&gt;heci0: found ME client at address 0x02:
&lt;br&gt;heci0: 	status = 0x00
&lt;br&gt;heci0: 	protocol_name(guid) = BB875E12-CB58-4D14-AE93-8566183C66C7
&lt;br&gt;heci0: found ME client at address 0x06:
&lt;br&gt;heci0: 	status = 0x00
&lt;br&gt;heci0: 	protocol_name(guid) = 9B27FD6D-EF72-4967-BCC2-471A32679620
&lt;br&gt;heci0: found ME client at address 0x07:
&lt;br&gt;heci0: 	status = 0x00
&lt;br&gt;heci0: 	protocol_name(guid) = 55213584-9A29-4916-BADF-0FB7ED682AEB
&lt;br&gt;heci0: found ME client at address 0x20:
&lt;br&gt;heci0: 	status = 0x00
&lt;br&gt;heci0: 	protocol_name(guid) = 309DCDE8-CCB1-4062-8F78-600115A34327
&lt;br&gt;heci0: found ME client at address 0x21:
&lt;br&gt;heci0: 	status = 0x00
&lt;br&gt;heci0: 	protocol_name(guid) = 23F27E9B-9D26-4FCE-9227-DE06446E5B06
&lt;br&gt;heci0: found ME client at address 0x22:
&lt;br&gt;heci0: 	status = 0x00
&lt;br&gt;heci0: 	protocol_name(guid) = 6733A4DB-0476-4E7B-B3AF-BCFC29BEE7A7
&lt;br&gt;heci0: found ME client at address 0x23:
&lt;br&gt;heci0: 	status = 0x00
&lt;br&gt;heci0: 	protocol_name(guid) = 12F80028-B4B7-4B2D-ACA8-46E0FF65814C
&lt;br&gt;heci0: found ME client at address 0x24:
&lt;br&gt;heci0: 	status = 0x00
&lt;br&gt;heci0: 	protocol_name(guid) = 05B79A6F-4628-4D7F-899D-A91514CB32AB
&lt;br&gt;&lt;br&gt;However, running the heci-qst.c program you supplied:
&lt;br&gt;&lt;br&gt;psi# ./heci-qst
&lt;br&gt;ioctl HECI_CONNECT: No such file or directory
&lt;br&gt;&lt;br&gt;And output to the console:
&lt;br&gt;&lt;br&gt;heci0: could not find ME client with given guid: 6B5205B9-8185-4519-B889-D98724B58607
&lt;br&gt;&lt;br&gt;Other than seeing that it doesn't appear in the list above, I don't know 
&lt;br&gt;if this is expected or not...
&lt;br&gt;&lt;br&gt;Secondly, I get a panic on module unlaod. &amp;nbsp;I haven't spent any time 
&lt;br&gt;looking at this, if you haven't fixed it yet let me know and I'll look 
&lt;br&gt;into it further.
&lt;br&gt;I'm not even sure how it's getting that far into the detach routine before 
&lt;br&gt;panicing, if dev really does = 0xdeadc0dedeadc0de
&lt;br&gt;&lt;br&gt;#8 &amp;nbsp;0xffffffff808580d3 in calltrap ()
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;at /usr/src/sys/amd64/amd64/exception.S:224
&lt;br&gt;#9 &amp;nbsp;0xffffffff8057ac3c in mtx_destroy (m=0xdeadc0dedeadc10e)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;at /usr/src/sys/kern/kern_mutex.c:827
&lt;br&gt;#10 0xffffffff812221c6 in heci_detach ()
&lt;br&gt;&amp;nbsp; &amp;nbsp; from /usr/src/sys/modules/heci/heci.ko
&lt;br&gt;#11 0xffffffff805b44d4 in device_detach (dev=0xdeadc0dedeadc0de)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;at device_if.h:212
&lt;br&gt;#12 0xffffffff805b4ac0 in driver_module_handler (mod=0xffffff0002d0f800, 
&lt;br&gt;what=Variable &amp;quot;what&amp;quot; is not available.
&lt;br&gt;) at /usr/src/sys/kern/subr_bus.c:1156
&lt;br&gt;#13 0xffffffff80578fc5 in module_unload (mod=0xffffff0002d0f800)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;at /usr/src/sys/kern/kern_module.c:266
&lt;br&gt;#14 0xffffffff8056fc0b in linker_file_unload (file=0xffffff0002c9c200,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;flags=0) at /usr/src/sys/kern/kern_linker.c:633
&lt;br&gt;#15 0xffffffff805707c3 in kern_kldunload (td=0xffffff0002950380, 
&lt;br&gt;fileid=Variable &amp;quot;fileid&amp;quot; is not available.
&lt;br&gt;) &amp;nbsp; &amp;nbsp;at /usr/src/sys/kern/kern_linker.c:1092
&lt;br&gt;&lt;br&gt;Let me know if there's anything else I can test.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;&lt;br&gt;Gavin
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273682&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273682&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/heci%3A-a-new-driver-for-review-and-testing-tp25895296p26273682.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26273093</id>
	<title>help needed to fix contrib/ee crash/exit when receiving SIGWINCH</title>
	<published>2009-11-09T12:24:46Z</published>
	<updated>2009-11-09T12:24:46Z</updated>
	<author>
		<name>Alexander Best-2</name>
	</author>
	<content type="html">since you've tested the patch on 7-stable do think it's mature enough to be
&lt;br&gt;committed to that branch?
&lt;br&gt;&lt;br&gt;alex
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273093&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26273093&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/help-needed-to-fix-contrib-ee-crash-exit-when-receiving-SIGWINCH-tp26273093p26273093.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26272199</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T11:24:56Z</published>
	<updated>2009-11-09T11:24:56Z</updated>
	<author>
		<name>Alexander Best-2</name>
	</author>
	<content type="html">here's the final patch. would be great if somebody could commit this one. the
&lt;br&gt;only thing i'm not 100% sure about are the burncd(8) changes. i'm not that
&lt;br&gt;familiar with the man syntax.
&lt;br&gt;&lt;br&gt;thanks go out to keramida@ and des@ for their help.
&lt;br&gt;&lt;br&gt;alex
&lt;br&gt;&lt;br&gt;...just realised the topic makes no sense. ;) what i meant to write was
&lt;br&gt;probably &amp;quot;[patch] burncd: honour envar SPEED&amp;quot;. ;)
&lt;br&gt;&lt;br /&gt;Index: usr.sbin/burncd/burncd.8
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.8	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.8	(working copy)
&lt;br&gt;@@ -27,7 +27,7 @@
&lt;br&gt;&amp;nbsp;.\&amp;quot;
&lt;br&gt;&amp;nbsp;.\&amp;quot; $FreeBSD$
&lt;br&gt;&amp;nbsp;.\&amp;quot;
&lt;br&gt;-.Dd May 2, 2005
&lt;br&gt;+.Dd Nov 9, 2009
&lt;br&gt;&amp;nbsp;.Os
&lt;br&gt;&amp;nbsp;.Dt BURNCD 8
&lt;br&gt;&amp;nbsp;.Sh NAME
&lt;br&gt;@@ -158,7 +158,11 @@
&lt;br&gt;&amp;nbsp;.Sh ENVIRONMENT
&lt;br&gt;&amp;nbsp;The following environment variables affect the execution of
&lt;br&gt;&amp;nbsp;.Nm :
&lt;br&gt;-.Bl -tag -width &amp;quot;.Ev CDROM&amp;quot;
&lt;br&gt;+.Bl -tag -width &amp;quot;.Ev BURNCD_SPEED&amp;quot;
&lt;br&gt;+.It Ev BURNCD_SPEED
&lt;br&gt;+The write speed to use if one is not specified with the
&lt;br&gt;+.Fl s
&lt;br&gt;+flag.
&lt;br&gt;&amp;nbsp;.It Ev CDROM
&lt;br&gt;&amp;nbsp;The CD device to use if one is not specified with the
&lt;br&gt;&amp;nbsp;.Fl f
&lt;br&gt;Index: usr.sbin/burncd/burncd.c
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.c	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.c	(working copy)
&lt;br&gt;@@ -80,11 +80,20 @@
&lt;br&gt;&amp;nbsp;	int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0;
&lt;br&gt;&amp;nbsp;	int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;nbsp;	int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;-	const char *dev;
&lt;br&gt;+	const char *dev, *env_speed;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	if ((env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;)) != NULL) {
&lt;br&gt;+		if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;+			speed = CDR_MAX_SPEED;
&lt;br&gt;+		else
&lt;br&gt;+			speed = atoi(env_speed) * 177;
&lt;br&gt;+		if (speed &amp;lt;= 0)
&lt;br&gt;+			errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, env_speed);
&lt;br&gt;+	}
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;nbsp;		switch (ch) {
&lt;br&gt;&amp;nbsp;		case 'd':
&lt;br&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26272199&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26272199&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26272199.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26271858</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T11:03:13Z</published>
	<updated>2009-11-09T11:03:13Z</updated>
	<author>
		<name>Alexander Best-2</name>
	</author>
	<content type="html">Giorgos Keramidas schrieb am 2009-11-09:
&lt;br&gt;&amp;gt; On Mon, 09 Nov 2009 19:01:43 +0100 (CET), Alexander Best
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26271858&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt;Giorgos Keramidas schrieb am 2009-11-09:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; i don't quite get why the value supplied with the envar has to
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; be
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; validated. &amp;nbsp;if the user supplies a speed value using the -s
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; switch
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; no validation (except &amp;lt;= 0) is being performed either.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; This is probably me being paranoid. &amp;nbsp;I'd prefer *both* places to
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; check the supplied value for invalid values, even if the check is
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; something like &amp;quot;negative numbers are not ok&amp;quot;.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; also i think there's a speed check in the atapi code. if the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; speed
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; requested is &amp;gt; the maximum driver speed it gets set to the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; maximum
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;gt; driver speed automatically.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Your patch is fine, but as a followup commit I'd probably like
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; seeing
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; atoi() go away. &amp;nbsp;AFAICT, it currently allows invalid speed values,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; defaulting to speed=0 when a user types:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; burncd -s foobar [options ...]
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; We can fix that later though :)
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; ok. so do you think this patch is sufficient then? once committed
&lt;br&gt;&amp;gt; &amp;gt; i'll
&lt;br&gt;&amp;gt; &amp;gt; see if i can add some extra validation to the envar as well as the
&lt;br&gt;&amp;gt; &amp;gt; -s
&lt;br&gt;&amp;gt; &amp;gt; switch and will also have a look at the validation the ATA code is
&lt;br&gt;&amp;gt; &amp;gt; doing atm.
&lt;br&gt;&lt;br&gt;&amp;gt; Yes, the patch attached below is fine, and IMO it would be ok to
&lt;br&gt;&amp;gt; commit
&lt;br&gt;&amp;gt; it, minus a couple of tiny details: sorting the BURNCD_SPEED
&lt;br&gt;&amp;gt; environment
&lt;br&gt;&amp;gt; variable before the current CDROM item in the manpage, and bumping
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; manpage modification date near .Dd to today.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; %%%
&lt;br&gt;&amp;gt; Index: usr.sbin/burncd/burncd.8
&lt;br&gt;&amp;gt; ===================================================================
&lt;br&gt;&amp;gt; --- usr.sbin/burncd/burncd.8 &amp;nbsp; &amp;nbsp;(revision 199064)
&lt;br&gt;&amp;gt; +++ usr.sbin/burncd/burncd.8 &amp;nbsp; &amp;nbsp;(working copy)
&lt;br&gt;&amp;gt; @@ -164,6 +164,12 @@
&lt;br&gt;&amp;gt; &amp;nbsp;.Fl f
&lt;br&gt;&amp;gt; &amp;nbsp;flag.
&lt;br&gt;&amp;gt; &amp;nbsp;.El
&lt;br&gt;&amp;gt; +.Bl -tag -width &amp;quot;.Ev BURNCD_SPEED&amp;quot;
&lt;br&gt;&amp;gt; +.It Ev BURNCD_SPEED
&lt;br&gt;&amp;gt; +The write speed to use if one is not specified with the
&lt;br&gt;&amp;gt; +.Fl s
&lt;br&gt;&amp;gt; +flag.
&lt;br&gt;&amp;gt; +.El
&lt;br&gt;&amp;gt; &amp;nbsp;.Sh FILES
&lt;br&gt;&amp;gt; &amp;nbsp;.Bl -tag -width &amp;quot;.Pa /dev/acd0&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp;.It Pa /dev/acd0
&lt;br&gt;&amp;gt; Index: usr.sbin/burncd/burncd.c
&lt;br&gt;&amp;gt; ===================================================================
&lt;br&gt;&amp;gt; --- usr.sbin/burncd/burncd.c &amp;nbsp; &amp;nbsp;(revision 199064)
&lt;br&gt;&amp;gt; +++ usr.sbin/burncd/burncd.c &amp;nbsp; &amp;nbsp;(working copy)
&lt;br&gt;&amp;gt; @@ -80,11 +80,20 @@
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; preemp = 0;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; const char *dev;
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; const char *dev, *env_speed;
&lt;/div&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;)) != NULL) {
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speed = CDR_MAX_SPEED;
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speed = atoi(env_speed) * 177;
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (speed &amp;lt;= 0)
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;,
&lt;br&gt;&amp;gt; &amp;nbsp; env_speed);
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (ch) {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 'd':
&lt;br&gt;&amp;gt; %%%
&lt;/div&gt;&lt;br&gt;ok. thanks a lot. maybe somebody will step up and commit this. i'm not
&lt;br&gt;familiar with the man() syntax so i might need some time to add the changes
&lt;br&gt;you recommended. also it seems the ENVIREMENT section needs to be aligned
&lt;br&gt;differently now that it has more than &amp;gt; 1 entry.
&lt;br&gt;&lt;br&gt;cheers.
&lt;br&gt;alex
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26271858&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26271858&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26271858.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26271012</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T10:07:29Z</published>
	<updated>2009-11-09T10:07:29Z</updated>
	<author>
		<name>Giorgos Keramidas-2</name>
	</author>
	<content type="html">On Mon, 09 Nov 2009 19:01:43 +0100 (CET), Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26271012&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;Giorgos Keramidas schrieb am 2009-11-09:
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; i don't quite get why the value supplied with the envar has to be
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; validated. &amp;nbsp;if the user supplies a speed value using the -s switch
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; no validation (except &amp;lt;= 0) is being performed either.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This is probably me being paranoid. &amp;nbsp;I'd prefer *both* places to
&lt;br&gt;&amp;gt;&amp;gt; check the supplied value for invalid values, even if the check is
&lt;br&gt;&amp;gt;&amp;gt; something like &amp;quot;negative numbers are not ok&amp;quot;.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; also i think there's a speed check in the atapi code. if the speed
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; requested is &amp;gt; the maximum driver speed it gets set to the maximum
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; driver speed automatically.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Your patch is fine, but as a followup commit I'd probably like seeing
&lt;br&gt;&amp;gt;&amp;gt; atoi() go away. &amp;nbsp;AFAICT, it currently allows invalid speed values,
&lt;br&gt;&amp;gt;&amp;gt; defaulting to speed=0 when a user types:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; burncd -s foobar [options ...]
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; We can fix that later though :)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ok. so do you think this patch is sufficient then? once committed i'll
&lt;br&gt;&amp;gt; see if i can add some extra validation to the envar as well as the -s
&lt;br&gt;&amp;gt; switch and will also have a look at the validation the ATA code is
&lt;br&gt;&amp;gt; doing atm.
&lt;/div&gt;&lt;/div&gt;Yes, the patch attached below is fine, and IMO it would be ok to commit
&lt;br&gt;it, minus a couple of tiny details: sorting the BURNCD_SPEED environment
&lt;br&gt;variable before the current CDROM item in the manpage, and bumping the
&lt;br&gt;manpage modification date near .Dd to today.
&lt;br&gt;&lt;br&gt;%%%
&lt;br&gt;Index: usr.sbin/burncd/burncd.8
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.8	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.8	(working copy)
&lt;br&gt;@@ -164,6 +164,12 @@
&lt;br&gt;&amp;nbsp;.Fl f
&lt;br&gt;&amp;nbsp;flag.
&lt;br&gt;&amp;nbsp;.El
&lt;br&gt;+.Bl -tag -width &amp;quot;.Ev BURNCD_SPEED&amp;quot;
&lt;br&gt;+.It Ev BURNCD_SPEED
&lt;br&gt;+The write speed to use if one is not specified with the
&lt;br&gt;+.Fl s
&lt;br&gt;+flag.
&lt;br&gt;+.El
&lt;br&gt;&amp;nbsp;.Sh FILES
&lt;br&gt;&amp;nbsp;.Bl -tag -width &amp;quot;.Pa /dev/acd0&amp;quot;
&lt;br&gt;&amp;nbsp;.It Pa /dev/acd0
&lt;br&gt;Index: usr.sbin/burncd/burncd.c
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.c	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.c	(working copy)
&lt;br&gt;@@ -80,11 +80,20 @@
&lt;br&gt;&amp;nbsp;	int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0;
&lt;br&gt;&amp;nbsp;	int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;nbsp;	int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;-	const char *dev;
&lt;br&gt;+	const char *dev, *env_speed;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	if ((env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;)) != NULL) {
&lt;br&gt;+		if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;+			speed = CDR_MAX_SPEED;
&lt;br&gt;+		else
&lt;br&gt;+			speed = atoi(env_speed) * 177;
&lt;br&gt;+		if (speed &amp;lt;= 0)
&lt;br&gt;+			errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, env_speed);
&lt;br&gt;+	}
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;nbsp;		switch (ch) {
&lt;br&gt;&amp;nbsp;		case 'd':
&lt;br&gt;%%%
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (201 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26271012/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26271012.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26270928</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T10:01:43Z</published>
	<updated>2009-11-09T10:01:43Z</updated>
	<author>
		<name>Alexander Best-2</name>
	</author>
	<content type="html">Giorgos Keramidas schrieb am 2009-11-09:
&lt;br&gt;&amp;gt; On Mon, 09 Nov 2009 15:28:29 +0100 (CET), Alexander Best
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26270928&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; Giorgos Keramidas schrieb am 2009-11-09:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Hi Alexander,
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; The idea seems very good, but since the value of SPEED is user
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; supplied data, I would rather see a bit of validation code after
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; getenv(). &amp;nbsp;With this version of the patch, burncd would happily
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; accept and try to use values that are quite absurd, i.e.:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; env SPEED=12234567890 burncd ...
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; It may also be sensible to do the translation from &amp;quot;human
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; readable&amp;quot;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; speed values and the multiplication with 177 _after_ the value has
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; been parsed from getenv(), so that e.g. one can write:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; env SPEED=4 burncd
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; and get behavior similar to the current default.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; i don't quite get why the value supplied with the envar has to be
&lt;br&gt;&amp;gt; &amp;gt; validated. &amp;nbsp;if the user supplies a speed value using the -s switch
&lt;br&gt;&amp;gt; &amp;gt; no
&lt;br&gt;&amp;gt; &amp;gt; validation (except &amp;lt;= 0) is being performed either.
&lt;br&gt;&lt;br&gt;&amp;gt; This is probably me being paranoid. &amp;nbsp;I'd prefer *both* places to
&lt;br&gt;&amp;gt; check
&lt;br&gt;&amp;gt; the supplied value for invalid values, even if the check is something
&lt;br&gt;&amp;gt; like &amp;quot;negative numbers are not ok&amp;quot;.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; also i think there's a speed check in the atapi code. if the speed
&lt;br&gt;&amp;gt; &amp;gt; requested is &amp;gt; the maximum driver speed it gets set to the maximum
&lt;br&gt;&amp;gt; &amp;gt; driver speed automatically.
&lt;br&gt;&lt;br&gt;&amp;gt; If the capping happens automatically we're fine. &amp;nbsp;From a cursory look
&lt;br&gt;&amp;gt; at
&lt;br&gt;&amp;gt; the kernel sources this morning, I didn't manage to find a
&lt;br&gt;&amp;gt; speed-range
&lt;br&gt;&amp;gt; check in sys/dev/ata. &amp;nbsp;The acd_set_speed() code is a small function:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; : static int
&lt;br&gt;&amp;gt; : acd_set_speed(device_t dev, int rdspeed, int wrspeed)
&lt;br&gt;&amp;gt; : {
&lt;br&gt;&amp;gt; : &amp;nbsp; &amp;nbsp; int8_t ccb[16] = { ATAPI_SET_SPEED, 0, rdspeed &amp;gt;&amp;gt; 8, rdspeed,
&lt;br&gt;&amp;gt; : &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;wrspeed &amp;gt;&amp;gt; 8, wrspeed, 0, 0, 0, 0, 0, 0, 0,
&lt;br&gt;&amp;gt; &amp;nbsp; 0, 0, 0 };
&lt;br&gt;&amp;gt; : &amp;nbsp; &amp;nbsp; int error;
&lt;br&gt;&amp;gt; :
&lt;br&gt;&amp;gt; : &amp;nbsp; &amp;nbsp; error = ata_atapicmd(dev, ccb, NULL, 0, 0, 30);
&lt;br&gt;&amp;gt; : &amp;nbsp; &amp;nbsp; if (!error)
&lt;br&gt;&amp;gt; : &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acd_get_cap(dev);
&lt;br&gt;&amp;gt; : &amp;nbsp; &amp;nbsp; return error;
&lt;br&gt;&amp;gt; : }
&lt;/div&gt;&lt;br&gt;&amp;gt; and that's all. &amp;nbsp;It probably relies on the hardware to cap the speed,
&lt;br&gt;&amp;gt; but I am not very familiar with the rest of the ATA code to be sure.
&lt;/div&gt;&lt;br&gt;&amp;gt; Your patch is fine, but as a followup commit I'd probably like seeing
&lt;br&gt;&amp;gt; atoi() go away. &amp;nbsp;AFAICT, it currently allows invalid speed values,
&lt;br&gt;&amp;gt; defaulting to speed=0 when a user types:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; burncd -s foobar [options ...]
&lt;br&gt;&lt;br&gt;&amp;gt; We can fix that later though :)
&lt;br&gt;&lt;br&gt;ok. so do you think this patch is sufficient then? once committed i'll see if
&lt;br&gt;i can add some extra validation to the envar as well as the -s switch and will
&lt;br&gt;also have a look at the validation the ATA code is doing atm.
&lt;br&gt;&lt;br&gt;alex
&lt;br&gt;&lt;br /&gt;Index: usr.sbin/burncd/burncd.8
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.8	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.8	(working copy)
&lt;br&gt;@@ -164,6 +164,12 @@
&lt;br&gt;&amp;nbsp;.Fl f
&lt;br&gt;&amp;nbsp;flag.
&lt;br&gt;&amp;nbsp;.El
&lt;br&gt;+.Bl -tag -width &amp;quot;.Ev BURNCD_SPEED&amp;quot;
&lt;br&gt;+.It Ev BURNCD_SPEED
&lt;br&gt;+The write speed to use if one is not specified with the
&lt;br&gt;+.Fl s
&lt;br&gt;+flag.
&lt;br&gt;+.El
&lt;br&gt;&amp;nbsp;.Sh FILES
&lt;br&gt;&amp;nbsp;.Bl -tag -width &amp;quot;.Pa /dev/acd0&amp;quot;
&lt;br&gt;&amp;nbsp;.It Pa /dev/acd0
&lt;br&gt;Index: usr.sbin/burncd/burncd.c
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.c	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.c	(working copy)
&lt;br&gt;@@ -80,11 +80,20 @@
&lt;br&gt;&amp;nbsp;	int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0;
&lt;br&gt;&amp;nbsp;	int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;nbsp;	int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;-	const char *dev;
&lt;br&gt;+	const char *dev, *env_speed;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	if ((env_speed = getenv(&amp;quot;BURNCD_SPEED&amp;quot;)) != NULL) {
&lt;br&gt;+		if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;+			speed = CDR_MAX_SPEED;
&lt;br&gt;+		else
&lt;br&gt;+			speed = atoi(env_speed) * 177;
&lt;br&gt;+		if (speed &amp;lt;= 0)
&lt;br&gt;+			errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, env_speed);
&lt;br&gt;+	}
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;nbsp;		switch (ch) {
&lt;br&gt;&amp;nbsp;		case 'd':
&lt;br&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26270928&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26270928&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26270928.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26268815</id>
	<title>Re: mmap(2) with MAP_ANON honouring offset although it shouldn't</title>
	<published>2009-11-09T07:57:52Z</published>
	<updated>2009-11-09T07:57:52Z</updated>
	<author>
		<name>Alexander Best-2</name>
	</author>
	<content type="html">John Baldwin schrieb am 2009-11-09:
&lt;br&gt;&amp;gt; On Saturday 07 November 2009 9:19:05 pm Alexander Best wrote:
&lt;br&gt;&amp;gt; &amp;gt; no problem. i've sent the final patch as followup to kern/71258 and
&lt;br&gt;&amp;gt; &amp;gt; also
&lt;br&gt;&amp;gt; &amp;gt; attached it to this message. to make it short. what's being changed
&lt;br&gt;&amp;gt; &amp;gt; by the
&lt;br&gt;&amp;gt; &amp;gt; patch:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; 1) if MAP_ANON is defined and offset !=0 &amp;nbsp;====&amp;gt; &amp;nbsp;return EINVAL
&lt;br&gt;&amp;gt; &amp;gt; 2) if MAP_STACK is defined and offset !=0 &amp;nbsp; ====&amp;gt; &amp;nbsp;offset = 0
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; would be great if you could have a look at the patch if you've got
&lt;br&gt;&amp;gt; &amp;gt; a spare
&lt;br&gt;&amp;gt; &amp;gt; minute.
&lt;br&gt;&lt;br&gt;&amp;gt; I didn't think 2) changed? &amp;nbsp;I.e. both the old and new code do this,
&lt;br&gt;&amp;gt; so only 1)
&lt;br&gt;&amp;gt; is changing?
&lt;br&gt;&lt;br&gt;you're right sorry about that mistake. so the only aspect of mmap() the patch
&lt;br&gt;changes is:
&lt;br&gt;&lt;br&gt;if MAP_ANON is defined and offset !=0 &amp;nbsp;====&amp;gt; &amp;nbsp;return EINVAL
&lt;br&gt;&lt;br&gt;cheers.
&lt;br&gt;alex
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26268815&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26268815&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mmap%282%29-with-MAP_ANON-honouring-offset-although-it-shouldn%27t-tp26250472p26268815.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26267723</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T06:52:09Z</published>
	<updated>2009-11-09T06:52:09Z</updated>
	<author>
		<name>Giorgos Keramidas-2</name>
	</author>
	<content type="html">On Mon, 09 Nov 2009 15:28:29 +0100 (CET), Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26267723&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Giorgos Keramidas schrieb am 2009-11-09:
&lt;br&gt;&amp;gt;&amp;gt; Hi Alexander,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The idea seems very good, but since the value of SPEED is user
&lt;br&gt;&amp;gt;&amp;gt; supplied data, I would rather see a bit of validation code after
&lt;br&gt;&amp;gt;&amp;gt; getenv(). &amp;nbsp;With this version of the patch, burncd would happily
&lt;br&gt;&amp;gt;&amp;gt; accept and try to use values that are quite absurd, i.e.:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; env SPEED=12234567890 burncd ...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; It may also be sensible to do the translation from &amp;quot;human readable&amp;quot;
&lt;br&gt;&amp;gt;&amp;gt; speed values and the multiplication with 177 _after_ the value has
&lt;br&gt;&amp;gt;&amp;gt; been parsed from getenv(), so that e.g. one can write:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; env SPEED=4 burncd
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; and get behavior similar to the current default.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; i don't quite get why the value supplied with the envar has to be
&lt;br&gt;&amp;gt; validated. &amp;nbsp;if the user supplies a speed value using the -s switch no
&lt;br&gt;&amp;gt; validation (except &amp;lt;= 0) is being performed either.
&lt;/div&gt;&lt;br&gt;This is probably me being paranoid. &amp;nbsp;I'd prefer *both* places to check
&lt;br&gt;the supplied value for invalid values, even if the check is something
&lt;br&gt;like &amp;quot;negative numbers are not ok&amp;quot;.
&lt;br&gt;&lt;br&gt;&amp;gt; also i think there's a speed check in the atapi code. if the speed
&lt;br&gt;&amp;gt; requested is &amp;gt; the maximum driver speed it gets set to the maximum
&lt;br&gt;&amp;gt; driver speed automatically.
&lt;br&gt;&lt;br&gt;If the capping happens automatically we're fine. &amp;nbsp;From a cursory look at
&lt;br&gt;the kernel sources this morning, I didn't manage to find a speed-range
&lt;br&gt;check in sys/dev/ata. &amp;nbsp;The acd_set_speed() code is a small function:
&lt;br&gt;&lt;br&gt;: static int
&lt;br&gt;: acd_set_speed(device_t dev, int rdspeed, int wrspeed)
&lt;br&gt;: {
&lt;br&gt;: &amp;nbsp; &amp;nbsp; int8_t ccb[16] = { ATAPI_SET_SPEED, 0, rdspeed &amp;gt;&amp;gt; 8, rdspeed,
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;wrspeed &amp;gt;&amp;gt; 8, wrspeed, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
&lt;br&gt;: &amp;nbsp; &amp;nbsp; int error;
&lt;br&gt;:
&lt;br&gt;: &amp;nbsp; &amp;nbsp; error = ata_atapicmd(dev, ccb, NULL, 0, 0, 30);
&lt;br&gt;: &amp;nbsp; &amp;nbsp; if (!error)
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; acd_get_cap(dev);
&lt;br&gt;: &amp;nbsp; &amp;nbsp; return error;
&lt;br&gt;: }
&lt;br&gt;&lt;br&gt;and that's all. &amp;nbsp;It probably relies on the hardware to cap the speed,
&lt;br&gt;but I am not very familiar with the rest of the ATA code to be sure.
&lt;br&gt;&lt;br&gt;Your patch is fine, but as a followup commit I'd probably like seeing
&lt;br&gt;atoi() go away. &amp;nbsp;AFAICT, it currently allows invalid speed values,
&lt;br&gt;defaulting to speed=0 when a user types:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; burncd -s foobar [options ...]
&lt;br&gt;&lt;br&gt;We can fix that later though :)
&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26267723&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26267723&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26267723.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26267515</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T06:39:14Z</published>
	<updated>2009-11-09T06:39:14Z</updated>
	<author>
		<name>Alexander Best</name>
	</author>
	<content type="html">Giorgos Keramidas schrieb am 2009-11-09:
&lt;br&gt;&amp;gt; On Mon, 09 Nov 2009 01:47:40 +0100 (CET), Alexander Best
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26267515&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; any thoughts on these small changes to burncd?
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; Index: usr.sbin/burncd/burncd.c
&lt;br&gt;&amp;gt; &amp;gt; ===================================================================
&lt;br&gt;&amp;gt; &amp;gt; --- usr.sbin/burncd/burncd.c &amp;nbsp;(revision 199064)
&lt;br&gt;&amp;gt; &amp;gt; +++ usr.sbin/burncd/burncd.c &amp;nbsp;(working copy)
&lt;br&gt;&amp;gt; &amp;gt; @@ -78,13 +78,16 @@
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp;{
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; int arg, addr, ch, fd;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0,
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; preemp = 0;
&lt;br&gt;&amp;gt; &amp;gt; - &amp;nbsp; &amp;nbsp; int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; int nogap = 0, speed = 0, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; const char *dev;
&lt;/div&gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; if ((speed = getenv(&amp;quot;SPEED&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speed = 4 * 177;
&lt;br&gt;&amp;gt; &amp;gt; +
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; switch (ch) {
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case 'd':
&lt;br&gt;&lt;br&gt;&amp;gt; Hi Alexander,
&lt;br&gt;&lt;br&gt;&amp;gt; The idea seems very good, but since the value of SPEED is user
&lt;br&gt;&amp;gt; supplied
&lt;br&gt;&amp;gt; data, I would rather see a bit of validation code after getenv().
&lt;br&gt;&amp;gt; With
&lt;br&gt;&amp;gt; this version of the patch, burncd would happily accept and try to use
&lt;br&gt;&amp;gt; values that are quite absurd, i.e.:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; env SPEED=12234567890 burncd ...
&lt;br&gt;&lt;br&gt;&amp;gt; It may also be sensible to do the translation from &amp;quot;human readable&amp;quot;
&lt;br&gt;&amp;gt; speed values and the multiplication with 177 _after_ the value has
&lt;br&gt;&amp;gt; been
&lt;br&gt;&amp;gt; parsed from getenv(), so that e.g. one can write:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; env SPEED=4 burncd
&lt;br&gt;&lt;br&gt;&amp;gt; and get behavior similar to the current default.
&lt;br&gt;&lt;br&gt;i don't quite get why the value supplied with the envar has to be validated.
&lt;br&gt;if the user supplies a speed value using the -s switch no validation (except
&lt;br&gt;&amp;lt;= 0) is being performed either.
&lt;br&gt;&lt;br&gt;also i think there's a speed check in the atapi code. if the speed requested
&lt;br&gt;is &amp;gt; the maximum driver speed it gets set to the maximum driver speed
&lt;br&gt;automatically.
&lt;br&gt;&lt;br&gt;cheers.
&lt;br&gt;alex
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26267515&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26267515&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26267515.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26268704</id>
	<title>Re: mmap(2) with MAP_ANON honouring offset although it shouldn't</title>
	<published>2009-11-09T06:31:12Z</published>
	<updated>2009-11-09T06:31:12Z</updated>
	<author>
		<name>John Baldwin</name>
	</author>
	<content type="html">On Saturday 07 November 2009 9:19:05 pm Alexander Best wrote:
&lt;br&gt;&amp;gt; no problem. i've sent the final patch as followup to kern/71258 and also
&lt;br&gt;&amp;gt; attached it to this message. to make it short. what's being changed by the
&lt;br&gt;&amp;gt; patch:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1) if MAP_ANON is defined and offset !=0 &amp;nbsp;====&amp;gt; &amp;nbsp;return EINVAL
&lt;br&gt;&amp;gt; 2) if MAP_STACK is defined and offset !=0 &amp;nbsp; ====&amp;gt; &amp;nbsp;offset = 0
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; would be great if you could have a look at the patch if you've got a spare
&lt;br&gt;&amp;gt; minute.
&lt;br&gt;&lt;br&gt;I didn't think 2) changed? &amp;nbsp;I.e. both the old and new code do this, so only 1) 
&lt;br&gt;is changing?
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;John Baldwin
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26268704&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26268704&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/mmap%282%29-with-MAP_ANON-honouring-offset-although-it-shouldn%27t-tp26250472p26268704.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26268677</id>
	<title>Re: Why is default value of NKPT so small?  mfsroot</title>
	<published>2009-11-09T06:27:04Z</published>
	<updated>2009-11-09T06:27:04Z</updated>
	<author>
		<name>John Baldwin</name>
	</author>
	<content type="html">On Friday 06 November 2009 2:19:51 pm Trever wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Does anyone know what the thinking is behind the default value of NKTP in /usr/src/sys/i386/include/pmap.h?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It seems to me that it's too small, though I'm wondering if there are some considerations in changing it's value that I should know about.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Too small because: making it a little more than twice as large (so you can get about a 300MB mfsroot to boot) means you can (by default) boot a standard FreeBSD system into memory, and I know I can't be the only one who would value that a great deal for many reasons. &amp;nbsp;As it stands you have to ax things out (like depenguinator does, for example). &amp;nbsp;Or you have to recompile the kernel. &amp;nbsp;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Does it have to be like this?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Which leads me to two more questions:
&lt;br&gt;&amp;gt; - is it possible to change the NKTP value without recompiling the kernel? &amp;nbsp;I think there isn't but I'll ask.
&lt;br&gt;&amp;gt; - is it possible to change the NKTP value without editing pmap.h (can I pass a variable into the kernel build process)?
&lt;/div&gt;&lt;br&gt;I keep meaning to make NKPT a kernel option for i386. &amp;nbsp;Try this patch, it
&lt;br&gt;should let you add 'options NKPT=xxx' to your kernel config.
&lt;br&gt;&lt;br&gt;Index: conf/options.i386
&lt;br&gt;===================================================================
&lt;br&gt;--- conf/options.i386	(revision 198997)
&lt;br&gt;+++ conf/options.i386	(working copy)
&lt;br&gt;@@ -12,6 +12,7 @@
&lt;br&gt;&amp;nbsp;MAXMEM
&lt;br&gt;&amp;nbsp;MPTABLE_FORCE_HTT
&lt;br&gt;&amp;nbsp;MP_WATCHDOG
&lt;br&gt;+NKPT			opt_pmap.h
&lt;br&gt;&amp;nbsp;PERFMON
&lt;br&gt;&amp;nbsp;PMAP_SHPGPERPROC	opt_pmap.h
&lt;br&gt;&amp;nbsp;POWERFAIL_NMI		opt_trap.h
&lt;br&gt;Index: i386/i386/mp_machdep.c
&lt;br&gt;===================================================================
&lt;br&gt;--- i386/i386/mp_machdep.c	(revision 198997)
&lt;br&gt;+++ i386/i386/mp_machdep.c	(working copy)
&lt;br&gt;@@ -30,6 +30,7 @@
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_cpu.h&amp;quot;
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_kstack_pages.h&amp;quot;
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_mp_watchdog.h&amp;quot;
&lt;br&gt;+#include &amp;quot;opt_pmap.h&amp;quot;
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_sched.h&amp;quot;
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_smp.h&amp;quot;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;Index: i386/xen/mp_machdep.c
&lt;br&gt;===================================================================
&lt;br&gt;--- i386/xen/mp_machdep.c	(revision 198997)
&lt;br&gt;+++ i386/xen/mp_machdep.c	(working copy)
&lt;br&gt;@@ -31,6 +31,7 @@
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_cpu.h&amp;quot;
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_kstack_pages.h&amp;quot;
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_mp_watchdog.h&amp;quot;
&lt;br&gt;+#include &amp;quot;opt_pmap.h&amp;quot;
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_sched.h&amp;quot;
&lt;br&gt;&amp;nbsp;#include &amp;quot;opt_smp.h&amp;quot;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;John Baldwin
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26268677&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26268677&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Why-is-default-value-of-NKPT-so-small---mfsroot-tp26237316p26268677.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26265669</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T04:32:21Z</published>
	<updated>2009-11-09T04:32:21Z</updated>
	<author>
		<name>Dag-Erling Smørgrav</name>
	</author>
	<content type="html">Giorgos Keramidas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26265669&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;keramida@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt; Dag-Erling Smørgrav &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26265669&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; man 3 expand_number
&lt;br&gt;&amp;gt; I know, but thanks. &amp;nbsp;In this case, expand_number's logic for parsing
&lt;br&gt;&amp;gt; possible SI suffixes is not useful and may be slightly confusing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm not sure what CDROM_SPEED='4m' would mean for burncd's -s option,
&lt;br&gt;&amp;gt; for example.
&lt;br&gt;&lt;br&gt;Hmm, I thought the speed was expressed in kBps or something...
&lt;br&gt;&lt;br&gt;DES
&lt;br&gt;-- 
&lt;br&gt;Dag-Erling Smørgrav - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26265669&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26265669&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26265669&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26265669.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26265239</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T03:37:22Z</published>
	<updated>2009-11-09T03:37:22Z</updated>
	<author>
		<name>Giorgos Keramidas-2</name>
	</author>
	<content type="html">On Mon, 09 Nov 2009 11:00:43 +0100, Dag-Erling Smørgrav &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26265239&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Giorgos Keramidas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26265239&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;keramida@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt;&amp;gt; atoi() doesn't really have error checking and it does not necessarily
&lt;br&gt;&amp;gt;&amp;gt; affect `errno'.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; man 3 expand_number
&lt;br&gt;&lt;br&gt;I know, but thanks. &amp;nbsp;In this case, expand_number's logic for parsing
&lt;br&gt;possible SI suffixes is not useful and may be slightly confusing.
&lt;br&gt;&lt;br&gt;I'm not sure what CDROM_SPEED='4m' would mean for burncd's -s option,
&lt;br&gt;for example.
&lt;br&gt;&lt;br&gt;&amp;gt; And please don't call it SPEED or WRITE_SPEED or anything generic; call
&lt;br&gt;&amp;gt; it BURNCD_SPEED or CDROM_BURN_SPEED or something unambiguous. &amp;nbsp;The envar
&lt;br&gt;&amp;gt; used to specify the device is called CDROM, not DEVICE.
&lt;br&gt;&lt;br&gt;Good point.
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (201 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26265239/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26265239.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26263754</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-09T02:00:43Z</published>
	<updated>2009-11-09T02:00:43Z</updated>
	<author>
		<name>Dag-Erling Smørgrav</name>
	</author>
	<content type="html">Giorgos Keramidas &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26263754&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;keramida@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&amp;gt; atoi() doesn't really have error checking and it does not necessarily
&lt;br&gt;&amp;gt; affect `errno'.
&lt;br&gt;&lt;br&gt;man 3 expand_number
&lt;br&gt;&lt;br&gt;And please don't call it SPEED or WRITE_SPEED or anything generic; call
&lt;br&gt;it BURNCD_SPEED or CDROM_BURN_SPEED or something unambiguous. &amp;nbsp;The envar
&lt;br&gt;used to specify the device is called CDROM, not DEVICE.
&lt;br&gt;&lt;br&gt;DES
&lt;br&gt;-- 
&lt;br&gt;Dag-Erling Smørgrav - &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26263754&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;des@...&lt;/a&gt;
&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26263754&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26263754&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26263754.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26262156</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-08T23:19:33Z</published>
	<updated>2009-11-08T23:19:33Z</updated>
	<author>
		<name>Giorgos Keramidas</name>
	</author>
	<content type="html">On Mon, 09 Nov 2009 02:22:36 +0100 (CET), Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26262156&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; --- burncd.c.typo	2009-11-09 02:19:47.000000000 +0100
&lt;br&gt;&amp;gt; +++ burncd.c	2009-11-09 02:20:27.000000000 +0100
&lt;br&gt;&amp;gt; @@ -85,8 +85,8 @@
&lt;br&gt;&amp;gt; &amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -	if ((env_speed = getenv(&amp;quot;WRITE_SPEED&amp;quot;)) != NULL)
&lt;br&gt;&amp;gt; -		if (strcasecmp(&amp;quot;max&amp;quot;, getenv) == 0)
&lt;br&gt;&amp;gt; +	if ((env_speed = getenv(&amp;quot;WRITE_SPEED&amp;quot;)) != NULL) {
&lt;br&gt;&amp;gt; +		if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;&amp;gt; &amp;nbsp;			speed = CDR_MAX_SPEED;
&lt;br&gt;&amp;gt; &amp;nbsp;		else
&lt;br&gt;&amp;gt; &amp;nbsp;			speed = atoi(env_speed) * 177;
&lt;/div&gt;&lt;/div&gt;atoi() doesn't really have error checking and it does not necessarily
&lt;br&gt;affect `errno'. &amp;nbsp;I'd probably prefer something that uses strtoul() and a
&lt;br&gt;few more value/range checks, i.e.:
&lt;br&gt;&lt;br&gt;: #include &amp;lt;limits.h&amp;gt;
&lt;br&gt;: #include &amp;lt;string.h&amp;gt;
&lt;br&gt;:
&lt;br&gt;: {
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; char *endp;
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; long xspeed;
&lt;br&gt;:
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speed = 4 * 177;
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((env_speed = getenv(&amp;quot;SPEED&amp;quot;)) != NULL) {
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0) {
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speed = CDR_MAX_SPEED;
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end = NULL;
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; errno = 0;
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xspeed = strtol(env_speed, &amp;endp, 0);
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (errno != 0 || (endp != NULL &amp;&amp; endp != str &amp;&amp;
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *endp != '\0' &amp;&amp; (isdigit(*endp) != 0 ||
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; isspace(*endp) == 0)))
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; err(1, &amp;quot;invalid write speed: %s&amp;quot;, env_speed);
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (xspeed &amp;lt; 0 || xspeed &amp;gt; INT_MAX)
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; err(1, &amp;quot;write speed out of range: %ld&amp;quot;, xspeed);
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; speed = (int)xspeed * 177;
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;: }
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (201 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26262156/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26262156.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26262074</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-08T23:10:06Z</published>
	<updated>2009-11-08T23:10:06Z</updated>
	<author>
		<name>Giorgos Keramidas</name>
	</author>
	<content type="html">On Mon, 09 Nov 2009 01:47:40 +0100 (CET), Alexander Best &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26262074&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alexbestms@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; any thoughts on these small changes to burncd?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Index: usr.sbin/burncd/burncd.c
&lt;br&gt;&amp;gt; ===================================================================
&lt;br&gt;&amp;gt; --- usr.sbin/burncd/burncd.c	(revision 199064)
&lt;br&gt;&amp;gt; +++ usr.sbin/burncd/burncd.c	(working copy)
&lt;br&gt;&amp;gt; @@ -78,13 +78,16 @@
&lt;br&gt;&amp;gt; &amp;nbsp;{
&lt;br&gt;&amp;gt; &amp;nbsp;	int arg, addr, ch, fd;
&lt;br&gt;&amp;gt; &amp;nbsp;	int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0;
&lt;br&gt;&amp;gt; -	int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; +	int nogap = 0, speed = 0, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;nbsp;	int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;&amp;gt; &amp;nbsp;	const char *dev;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; +	if ((speed = getenv(&amp;quot;SPEED&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; +		speed = 4 * 177;
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt; &amp;nbsp;	while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;gt; &amp;nbsp;		switch (ch) {
&lt;br&gt;&amp;gt; &amp;nbsp;		case 'd':
&lt;/div&gt;&lt;/div&gt;Hi Alexander,
&lt;br&gt;&lt;br&gt;The idea seems very good, but since the value of SPEED is user supplied
&lt;br&gt;data, I would rather see a bit of validation code after getenv(). &amp;nbsp;With
&lt;br&gt;this version of the patch, burncd would happily accept and try to use
&lt;br&gt;values that are quite absurd, i.e.:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; env SPEED=12234567890 burncd ...
&lt;br&gt;&lt;br&gt;It may also be sensible to do the translation from &amp;quot;human readable&amp;quot;
&lt;br&gt;speed values and the multiplication with 177 _after_ the value has been
&lt;br&gt;parsed from getenv(), so that e.g. one can write:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; env SPEED=4 burncd
&lt;br&gt;&lt;br&gt;and get behavior similar to the current default.
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (201 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26262074/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26262074.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26259998</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-08T17:22:36Z</published>
	<updated>2009-11-08T17:22:36Z</updated>
	<author>
		<name>Alexander Best</name>
	</author>
	<content type="html">Gabor Kovesdan schrieb am 2009-11-09:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Gabor Kovesdan escribió:
&lt;br&gt;&amp;gt; &amp;gt;Alexander Best escribió:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;any thoughts on these small changes to burncd?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; - &amp;nbsp; &amp;nbsp;int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;+ &amp;nbsp; &amp;nbsp;int nogap = 0, speed = 0, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;const char *dev;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;+ &amp;nbsp; &amp;nbsp;if ((speed = getenv(&amp;quot;SPEED&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;speed = 4 * 177;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;+
&lt;br&gt;&amp;gt; &amp;gt;It seems incorrect. The speed variable is of type int, while getenv
&lt;br&gt;&amp;gt; &amp;gt;returns char *. You should first assign getenv(&amp;quot;SPEED&amp;quot;) to a char *
&lt;br&gt;&amp;gt; &amp;gt;variable and if it isn't NULL then you should convert it to int or
&lt;br&gt;&amp;gt; &amp;gt;fall back to the default value otherwise.
&lt;br&gt;&amp;gt; And one more thing. Personally, I think that a more
&lt;br&gt;&amp;gt; specific/descriptive name would be better, e.g. BURNCD_SPEED. SPEED
&lt;br&gt;&amp;gt; is just too general.
&lt;/div&gt;&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Gabor Kovesdan
&lt;br&gt;&amp;gt; FreeBSD Volunteer
&lt;/div&gt;&lt;br&gt;&amp;gt; EMAIL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259998&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gabor@...&lt;/a&gt; .:|:. &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259998&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gabor@...&lt;/a&gt;
&lt;br&gt;&amp;gt; WEB: &amp;nbsp; &lt;a href=&quot;http://people.FreeBSD.org/~gabor&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://people.FreeBSD.org/~gabor&lt;/a&gt;&amp;nbsp;.:|:. &lt;a href=&quot;http://kovesdan.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://kovesdan.org&lt;/a&gt;&lt;br&gt;&lt;br&gt;ooops. this one fixes the typos. ;)
&lt;br&gt;&lt;br&gt;alex
&lt;br&gt;&lt;br /&gt;--- burncd.c.typo	2009-11-09 02:19:47.000000000 +0100
&lt;br&gt;+++ burncd.c	2009-11-09 02:20:27.000000000 +0100
&lt;br&gt;@@ -85,8 +85,8 @@
&lt;br&gt;&amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-	if ((env_speed = getenv(&amp;quot;WRITE_SPEED&amp;quot;)) != NULL)
&lt;br&gt;-		if (strcasecmp(&amp;quot;max&amp;quot;, getenv) == 0)
&lt;br&gt;+	if ((env_speed = getenv(&amp;quot;WRITE_SPEED&amp;quot;)) != NULL) {
&lt;br&gt;+		if (strcasecmp(&amp;quot;max&amp;quot;, env_speed) == 0)
&lt;br&gt;&amp;nbsp;			speed = CDR_MAX_SPEED;
&lt;br&gt;&amp;nbsp;		else
&lt;br&gt;&amp;nbsp;			speed = atoi(env_speed) * 177;
&lt;br&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259998&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259998&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26259998.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26259976</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-08T17:19:05Z</published>
	<updated>2009-11-08T17:19:05Z</updated>
	<author>
		<name>Alexander Best</name>
	</author>
	<content type="html">Gabor Kovesdan schrieb am 2009-11-09:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Gabor Kovesdan escribió:
&lt;br&gt;&amp;gt; &amp;gt;Alexander Best escribió:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;any thoughts on these small changes to burncd?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; - &amp;nbsp; &amp;nbsp;int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;+ &amp;nbsp; &amp;nbsp;int nogap = 0, speed = 0, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;const char *dev;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;+ &amp;nbsp; &amp;nbsp;if ((speed = getenv(&amp;quot;SPEED&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;speed = 4 * 177;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;+
&lt;br&gt;&amp;gt; &amp;gt;It seems incorrect. The speed variable is of type int, while getenv
&lt;br&gt;&amp;gt; &amp;gt;returns char *. You should first assign getenv(&amp;quot;SPEED&amp;quot;) to a char *
&lt;br&gt;&amp;gt; &amp;gt;variable and if it isn't NULL then you should convert it to int or
&lt;br&gt;&amp;gt; &amp;gt;fall back to the default value otherwise.
&lt;br&gt;&amp;gt; And one more thing. Personally, I think that a more
&lt;br&gt;&amp;gt; specific/descriptive name would be better, e.g. BURNCD_SPEED. SPEED
&lt;br&gt;&amp;gt; is just too general.
&lt;/div&gt;&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Gabor Kovesdan
&lt;br&gt;&amp;gt; FreeBSD Volunteer
&lt;/div&gt;&lt;br&gt;&amp;gt; EMAIL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259976&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gabor@...&lt;/a&gt; .:|:. &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259976&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gabor@...&lt;/a&gt;
&lt;br&gt;&amp;gt; WEB: &amp;nbsp; &lt;a href=&quot;http://people.FreeBSD.org/~gabor&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://people.FreeBSD.org/~gabor&lt;/a&gt;&amp;nbsp;.:|:. &lt;a href=&quot;http://kovesdan.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://kovesdan.org&lt;/a&gt;&lt;br&gt;&lt;br&gt;thanks for the help. how about this revised patch?
&lt;br&gt;&lt;br&gt;cheers.
&lt;br&gt;alex
&lt;br&gt;&lt;br /&gt;Index: usr.sbin/burncd/burncd.8
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.8	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.8	(working copy)
&lt;br&gt;@@ -164,6 +164,12 @@
&lt;br&gt;&amp;nbsp;.Fl f
&lt;br&gt;&amp;nbsp;flag.
&lt;br&gt;&amp;nbsp;.El
&lt;br&gt;+.Bl -tag -width &amp;quot;.Ev WRITE_SPEED&amp;quot;
&lt;br&gt;+.It Ev WRITE_SPEED
&lt;br&gt;+The write speed to use if one is not specified with the
&lt;br&gt;+.Fl s
&lt;br&gt;+flag.
&lt;br&gt;+.El
&lt;br&gt;&amp;nbsp;.Sh FILES
&lt;br&gt;&amp;nbsp;.Bl -tag -width &amp;quot;.Pa /dev/acd0&amp;quot;
&lt;br&gt;&amp;nbsp;.It Pa /dev/acd0
&lt;br&gt;Index: usr.sbin/burncd/burncd.c
&lt;br&gt;===================================================================
&lt;br&gt;--- usr.sbin/burncd/burncd.c	(revision 199064)
&lt;br&gt;+++ usr.sbin/burncd/burncd.c	(working copy)
&lt;br&gt;@@ -80,11 +80,20 @@
&lt;br&gt;&amp;nbsp;	int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0;
&lt;br&gt;&amp;nbsp;	int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;nbsp;	int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;-	const char *dev;
&lt;br&gt;+	const char *dev, *env_speed;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	if ((env_speed = getenv(&amp;quot;WRITE_SPEED&amp;quot;)) != NULL)
&lt;br&gt;+		if (strcasecmp(&amp;quot;max&amp;quot;, getenv) == 0)
&lt;br&gt;+			speed = CDR_MAX_SPEED;
&lt;br&gt;+		else
&lt;br&gt;+			speed = atoi(env_speed) * 177;
&lt;br&gt;+		if (speed &amp;lt;= 0)
&lt;br&gt;+			errx(EX_USAGE, &amp;quot;Invalid speed: %s&amp;quot;, env_speed);
&lt;br&gt;+	}
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	while ((ch = getopt(argc, argv, &amp;quot;def:Flmnpqs:tv&amp;quot;)) != -1) {
&lt;br&gt;&amp;nbsp;		switch (ch) {
&lt;br&gt;&amp;nbsp;		case 'd':
&lt;br&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259976&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259976&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26259976.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26259857</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-08T17:02:36Z</published>
	<updated>2009-11-08T17:02:36Z</updated>
	<author>
		<name>Gabor Kovesdan-3</name>
	</author>
	<content type="html">Gabor Kovesdan escribió:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Alexander Best escribió:
&lt;br&gt;&amp;gt;&amp;gt; any thoughts on these small changes to burncd?
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; - &amp;nbsp; &amp;nbsp;int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;int nogap = 0, speed = 0, test_write = 0, force = 0;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;const char *dev;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp;if ((speed = getenv(&amp;quot;SPEED&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;speed = 4 * 177;
&lt;br&gt;&amp;gt;&amp;gt; +
&lt;br&gt;&amp;gt; It seems incorrect. The speed variable is of type int, while getenv 
&lt;br&gt;&amp;gt; returns char *. You should first assign getenv(&amp;quot;SPEED&amp;quot;) to a char * 
&lt;br&gt;&amp;gt; variable and if it isn't NULL then you should convert it to int or 
&lt;br&gt;&amp;gt; fall back to the default value otherwise.
&lt;/div&gt;And one more thing. Personally, I think that a more specific/descriptive 
&lt;br&gt;name would be better, e.g. BURNCD_SPEED. SPEED is just too general.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Gabor Kovesdan
&lt;br&gt;FreeBSD Volunteer
&lt;br&gt;&lt;br&gt;EMAIL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259857&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gabor@...&lt;/a&gt; .:|:. &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259857&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gabor@...&lt;/a&gt;
&lt;br&gt;WEB: &amp;nbsp; &lt;a href=&quot;http://people.FreeBSD.org/~gabor&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://people.FreeBSD.org/~gabor&lt;/a&gt;&amp;nbsp;.:|:. &lt;a href=&quot;http://kovesdan.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://kovesdan.org&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259857&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259857&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26259857.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26259787</id>
	<title>Re: [patch] burncd: honour for envar SPEED</title>
	<published>2009-11-08T16:53:14Z</published>
	<updated>2009-11-08T16:53:14Z</updated>
	<author>
		<name>Gabor Kovesdan-3</name>
	</author>
	<content type="html">Alexander Best escribió:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; any thoughts on these small changes to burncd?
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt; -	int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; +	int nogap = 0, speed = 0, test_write = 0, force = 0;
&lt;br&gt;&amp;gt; &amp;nbsp;	int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
&lt;br&gt;&amp;gt; &amp;nbsp;	const char *dev;
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;	if ((dev = getenv(&amp;quot;CDROM&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; &amp;nbsp;		dev = &amp;quot;/dev/acd0&amp;quot;;
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; +	if ((speed = getenv(&amp;quot;SPEED&amp;quot;)) == NULL)
&lt;br&gt;&amp;gt; +		speed = 4 * 177;
&lt;br&gt;&amp;gt; +
&lt;/div&gt;It seems incorrect. The speed variable is of type int, while getenv 
&lt;br&gt;returns char *. You should first assign getenv(&amp;quot;SPEED&amp;quot;) to a char * 
&lt;br&gt;variable and if it isn't NULL then you should convert it to int or fall 
&lt;br&gt;back to the default value otherwise.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Gabor Kovesdan
&lt;br&gt;FreeBSD Volunteer
&lt;br&gt;&lt;br&gt;EMAIL: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259787&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gabor@...&lt;/a&gt; .:|:. &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259787&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;gabor@...&lt;/a&gt;
&lt;br&gt;WEB: &amp;nbsp; &lt;a href=&quot;http://people.FreeBSD.org/~gabor&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://people.FreeBSD.org/~gabor&lt;/a&gt;&amp;nbsp;.:|:. &lt;a href=&quot;http://kovesdan.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://kovesdan.org&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259787&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers@...&lt;/a&gt; mailing list
&lt;br&gt;&lt;a href=&quot;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://lists.freebsd.org/mailman/listinfo/freebsd-hackers&lt;/a&gt;&lt;br&gt;To unsubscribe, send any mail to &amp;quot;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26259787&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;freebsd-hackers-unsubscribe@...&lt;/a&gt;&amp;quot;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-patch--burncd%3A-honour-for-envar-SPEED-tp26259741p26259787.html" />
</entry>

</feed>
