Date: Mon, 09 Nov 2009 02:19:05 +0100 (CET) From: Alexander Best <alexbestms@math.uni-muenster.de> To: Gabor Kovesdan <gabor@FreeBSD.org> Cc: freebsd-hackers@FreeBSD.org Subject: Re: [patch] burncd: honour for envar SPEED Message-ID: <permail-2009110901190580e26a0b0000354f-a_best01@message-id.uni-muenster.de> In-Reply-To: <4AF76A2C.400@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a MIME encoded multipart message. --+permail-2009110901190580e26a0b0000354f-a_best01+ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Gabor Kovesdan schrieb am 2009-11-09: > Gabor Kovesdan escribi=F3: > >Alexander Best escribi=F3: > >>any thoughts on these small changes to burncd? > >> - int nogap =3D 0, speed =3D 4 * 177, test_write =3D 0, force =3D 0= ; > >>+ int nogap =3D 0, speed =3D 0, test_write =3D 0, force =3D 0; > >> int block_size =3D 0, block_type =3D 0, cdopen =3D 0, dvdrw =3D 0; > >> const char *dev; > >> if ((dev =3D getenv("CDROM")) =3D=3D NULL) > >> dev =3D "/dev/acd0"; > >>+ if ((speed =3D getenv("SPEED")) =3D=3D NULL) > >>+ speed =3D 4 * 177; > >>+ > >It seems incorrect. The speed variable is of type int, while getenv > >returns char *. You should first assign getenv("SPEED") to a char * > >variable and if it isn't NULL then you should convert it to int or > >fall back to the default value otherwise. > And one more thing. Personally, I think that a more > specific/descriptive name would be better, e.g. BURNCD_SPEED. SPEED > is just too general. > -- > Gabor Kovesdan > FreeBSD Volunteer > EMAIL: gabor@FreeBSD.org .:|:. gabor@kovesdan.org > WEB: http://people.FreeBSD.org/~gabor .:|:. http://kovesdan.org thanks for the help. how about this revised patch? cheers. alex --+permail-2009110901190580e26a0b0000354f-a_best01+ Content-Type: text/plain Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename="burncdspeedpatch.txt" SW5kZXg6IHVzci5zYmluL2J1cm5jZC9idXJuY2QuOAo9PT09PT09PT09PT09PT09PT09PT09PT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wogCiAJaWYgKChkZXYgPSBnZXRlbnYoIkNEUk9NIikpID09 IE5VTEwpCiAJCWRldiA9ICIvZGV2L2FjZDAiOwogCisJaWYgKChlbnZfc3BlZWQgPSBnZXRlbnYo IldSSVRFX1NQRUVEIikpICE9IE5VTEwpCisJCWlmIChzdHJjYXNlY21wKCJtYXgiLCBnZXRlbnYp ID09IDApCisJCQlzcGVlZCA9IENEUl9NQVhfU1BFRUQ7CisJCWVsc2UKKwkJCXNwZWVkID0gYXRv aShlbnZfc3BlZWQpICogMTc3OworCQlpZiAoc3BlZWQgPD0gMCkKKwkJCWVycngoRVhfVVNBR0Us ICJJbnZhbGlkIHNwZWVkOiAlcyIsIGVudl9zcGVlZCk7CisJfQorCiAJd2hpbGUgKChjaCA9IGdl dG9wdChhcmdjLCBhcmd2LCAiZGVmOkZsbW5wcXM6dHYiKSkgIT0gLTEpIHsKIAkJc3dpdGNoIChj aCkgewogCQljYXNlICdkJzoK --+permail-2009110901190580e26a0b0000354f-a_best01+--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?permail-2009110901190580e26a0b0000354f-a_best01>