Subject: long vs. int bug in mt(1) Index: bin/mt.c 2.11BSD Description: mt(1) prints the count argument incorrectly when reporting an error. Repeat-By: Perform an operation which takes a 'count' operand: mt -f /dev/rmt0 fsf 1 The error is reported as: /dev/rmt0: fsf 0 failed instead of /dev/rmt0: fsf 1 failed Fix: The count member of the MTIOCTOP ioctl structure is a long and was being printed with '%d' instead of '%ld'. The fix is to change the printf format string. To apply this patch cut where indicated and save to a file (/tmp/411). Then: patch -p0 < /tmp/411 cd /usr/src/bin make mt install -m 751 -s -g staff mt /bin/mt As always this and previous updates to 2.11BSD are available via anonymous FTP to either FTP.IIPO.GTEGSC.COM or MOE.2BSD.COM in the directory /pub/2.11BSD. ---------------------------cut here----------------------- *** /usr/src/bin/mt.c.old Fri Dec 22 20:26:27 1995 --- /usr/src/bin/mt.c Sat Mar 20 22:10:05 1999 *************** *** 11,17 **** "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; ! static char sccsid[] = "@(#)mt.c 2.1 (2.11BSD) 1995/12/22"; #endif not lint /* --- 11,17 ---- "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; ! static char sccsid[] = "@(#)mt.c 2.2 (2.11BSD) 1999/3/20"; #endif not lint /* *************** *** 89,95 **** exit(1); } if (ioctl(mtfd, MTIOCTOP, &mt_com) < 0) { ! fprintf(stderr, "%s %s %d ", tape, comp->c_name, mt_com.mt_count); perror("failed"); exit(2); --- 89,95 ---- exit(1); } if (ioctl(mtfd, MTIOCTOP, &mt_com) < 0) { ! fprintf(stderr, "%s %s %ld ", tape, comp->c_name, mt_com.mt_count); perror("failed"); exit(2); *** /VERSION.old Wed Mar 10 19:40:59 1999 --- /VERSION Tue Mar 30 19:59:38 1999 *************** *** 1,5 **** ! Current Patch Level: 410 ! Date: March 10, 1999 2.11 BSD ============ --- 1,5 ---- ! Current Patch Level: 411 ! Date: March 30, 1999 2.11 BSD ============