Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jun 2001 20:18:25 -0400 (EDT)
From:      Mike Barcroft <mike@q9media.com>
To:        Soren Schmidt <sos@FreeBSD.org>
Cc:        audit@FreeBSD.org, Peter Pentchev <roam@orbitel.bg>, Mike Heffner <mheffner@novacoxmail.com>
Subject:   Re: src/usr.sbin/burncd patch
Message-ID:  <200106270018.f5R0IPj94518@coffee.q9media.com>

next in thread | raw e-mail | index | archive | help
Soren,
I have a clean up patch to burncd(8).  I would appreciate it if
you would review and commit the patch at the end of this message.
Also available at:
http://testbed.q9media.net/freebsd/burncd.20010627.patch


Best regards,
Mike Barcroft

-----------------------------------------------------------------------

o Clean up compile-time warnings.
o Set WARNS?=2

Index: burncd/Makefile
===================================================================
RCS file: /home/ncvs/src/usr.sbin/burncd/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- burncd/Makefile	2001/03/26 14:39:38	1.4
+++ burncd/Makefile	2001/06/26 23:49:00
@@ -1,6 +1,7 @@
 # $FreeBSD: src/usr.sbin/burncd/Makefile,v 1.4 2001/03/26 14:39:38 ru Exp $
 
 PROG=	burncd
+WARNS?=	2
 MAN=	burncd.8
 
 .include <bsd.prog.mk>
Index: burncd/burncd.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v
retrieving revision 1.13
diff -u -r1.13 burncd.c
--- burncd/burncd.c	2001/05/30 08:13:39	1.13
+++ burncd/burncd.c	2001/06/26 23:49:00
@@ -56,7 +56,7 @@
 {
 	int ch, arg, addr;
 	int eject=0, list=0, multi=0, preemp=0, speed=1, test_write=0;
-	char *devname = "/dev/acd0c", *prog_name;
+	const char *dev_name = "/dev/acd0c", *prog_name;
 	int block_size = 0;
 
 	prog_name = argv[0];
@@ -67,7 +67,7 @@
 			break;
 
 		case 'f':
-			devname = optarg;
+			dev_name = optarg;
 			break;
 
 		case 'l':
@@ -106,8 +106,8 @@
 	if (argc == 0)
 		usage(prog_name);
 
-	if ((fd = open(devname, O_RDWR, 0)) < 0)
-		err(EX_NOINPUT, "open(%s)", devname);
+	if ((fd = open(dev_name, O_RDWR, 0)) < 0)
+		err(EX_NOINPUT, "open(%s)", dev_name);
 
 	if (ioctl(fd, CDRIOCWRITESPEED, &speed) < 0) 
        		err(EX_IOERR, "ioctl(CDRIOCWRITESPEED)");
@@ -134,7 +134,7 @@
 				err(EX_IOERR, "ioctl(CDIOREADTOCENTRY)");
 			if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0) 
 				err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)");
-			fprintf(stderr, "%d, %d\n", 
+			fprintf(stderr, "%lu, %d\n", 
 				ntohl(entry.entry.addr.lba), addr);
 
 			break;
@@ -207,7 +207,7 @@
 			while (fgets(file_buf, sizeof(file_buf), fp) != NULL) {
 				if (*file_buf == '#' || *file_buf == '\n')
 					continue;
-				if (eol = strchr(file_buf, '\n'))
+				if ((eol = strchr(file_buf, '\n')) != NULL)
 					*eol = NULL;
 				write_file(file_buf, block_size);
 			}
@@ -233,7 +233,7 @@
 }
 
 void
-cleanup(int dummy)
+cleanup(int dummy __unused)
 {
 	if (ioctl(fd, CDRIOCSETBLOCKSIZE, &saved_block_size) < 0) 
 		err(EX_IOERR, "ioctl(CDRIOCSETBLOCKSIZE)");
@@ -252,7 +252,7 @@
 {
 	int addr, count, file, filesize, size;
 	char buf[2352*BLOCKS];
-	struct stat stat;
+	struct stat filestat;
 	static int cdopen, done_stdin, tot_size = 0;
 
 	if (!strcmp(name, "-")) {
@@ -278,9 +278,9 @@
 	if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0) 
        		err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)");
 
-	if (fstat(file, &stat) < 0)
+	if (fstat(file, &filestat) < 0)
 		err(EX_IOERR, "fstat(%s)", name);
-	filesize = stat.st_size / 1024;
+	filesize = filestat.st_size / 1024;
 
 	if (!quiet) {
 		fprintf(stderr, "next writeable LBA %d\n", addr);

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106270018.f5R0IPj94518>