From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 9 01:22:44 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5069106566B for ; Mon, 9 Nov 2009 01:22:44 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay1.uni-muenster.de (ZIVM-EXRELAY1.UNI-MUENSTER.DE [128.176.192.14]) by mx1.freebsd.org (Postfix) with ESMTP id 0944D8FC15 for ; Mon, 9 Nov 2009 01:22:43 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,705,1249250400"; d="txt'?scan'208";a="287744038" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay1.uni-muenster.de with ESMTP; 09 Nov 2009 02:22:43 +0100 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id 2453B1B07BE; Mon, 9 Nov 2009 02:22:43 +0100 (CET) Date: Mon, 09 Nov 2009 02:22:36 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Gabor Kovesdan Message-ID: In-Reply-To: <4AF76A2C.400@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=+permail-2009110901223680e26a0b000035b7-a_best01+ Cc: freebsd-hackers@FreeBSD.org Subject: Re: [patch] burncd: honour for envar SPEED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 01:22:44 -0000 This is a MIME encoded multipart message. --+permail-2009110901223680e26a0b000035b7-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 ooops. this one fixes the typos. ;) alex --+permail-2009110901223680e26a0b000035b7-a_best01+ Content-Type: text/plain Content-Transfer-Encoding: Base64 Content-Disposition: attachment; filename="burncdspeedpatchtypos.txt" LS0tIGJ1cm5jZC5jLnR5cG8JMjAwOS0xMS0wOSAwMjoxOTo0Ny4wMDAwMDAwMDAgKzAxMDAKKysr IGJ1cm5jZC5jCTIwMDktMTEtMDkgMDI6MjA6MjcuMDAwMDAwMDAwICswMTAwCkBAIC04NSw4ICs4 NSw4IEBACiAJaWYgKChkZXYgPSBnZXRlbnYoIkNEUk9NIikpID09IE5VTEwpCiAJCWRldiA9ICIv ZGV2L2FjZDAiOwogCi0JaWYgKChlbnZfc3BlZWQgPSBnZXRlbnYoIldSSVRFX1NQRUVEIikpICE9 IE5VTEwpCi0JCWlmIChzdHJjYXNlY21wKCJtYXgiLCBnZXRlbnYpID09IDApCisJaWYgKChlbnZf c3BlZWQgPSBnZXRlbnYoIldSSVRFX1NQRUVEIikpICE9IE5VTEwpIHsKKwkJaWYgKHN0cmNhc2Vj bXAoIm1heCIsIGVudl9zcGVlZCkgPT0gMCkKIAkJCXNwZWVkID0gQ0RSX01BWF9TUEVFRDsKIAkJ ZWxzZQogCQkJc3BlZWQgPSBhdG9pKGVudl9zcGVlZCkgKiAxNzc7Cg== --+permail-2009110901223680e26a0b000035b7-a_best01+--