[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: fdutils on arm



>Someone needs to work out and provide a fix for 97031/97545 (fdutils
>doesn't build on arm/unstable). 

This code scares me quite a lot, but here's a patch that at least makes it 
compile again.

p.

diff -upr clean/fdutils-5.3/src/diskd.c fdutils-5.3/src/diskd.c
--- clean/fdutils-5.3/src/diskd.c	Sun May 27 14:11:49 2001
+++ fdutils-5.3/src/diskd.c	Sun May 27 14:06:10 2001
@@ -9,8 +9,6 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <linux/fs.h>
-#include <linux/major.h>
 #include <string.h>
 #include "enh_options.h"
 
Only in fdutils-5.3/src: diskd.o
Only in fdutils-5.3/src: diskseekd
diff -upr clean/fdutils-5.3/src/diskseekd.c fdutils-5.3/src/diskseekd.c
--- clean/fdutils-5.3/src/diskseekd.c	Sun May 27 14:11:49 2001
+++ fdutils-5.3/src/diskseekd.c	Sun May 27 14:05:50 2001
@@ -9,7 +9,7 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <linux/fs.h>
+#include <sys/sysmacros.h>
 #include <linux/major.h>
 #include <string.h>
 #include "enh_options.h"
@@ -118,12 +118,12 @@ int main(int argc, char **argv)
 			perror("fstat");
 			exit(1);
 		}
-		if (MAJOR(buf.st_rdev) != FLOPPY_MAJOR) {
+		if (major(buf.st_rdev) != FLOPPY_MAJOR) {
 			fprintf(stderr,"Not a floppy drive\n");
 			exit(1);
 		}
 
-		drive = MINOR( buf.st_rdev );
+		drive = minor( buf.st_rdev );
 		drive = (drive & 3) + ((drive & 0x80) >> 5);
 
 		/* reset the fdc, if needed */
Only in fdutils-5.3/src: diskseekd.o
diff -upr clean/fdutils-5.3/src/driveprm.c fdutils-5.3/src/driveprm.c
--- clean/fdutils-5.3/src/driveprm.c	Sun May 27 14:11:49 2001
+++ fdutils-5.3/src/driveprm.c	Sun May 27 13:59:06 2001
@@ -1,10 +1,9 @@
 #include <stdlib.h>
 #include <stdio.h>
-#include <linux/fd.h>
 #include <sys/ioctl.h>
-#include <linux/fs.h>
-#include <linux/major.h>
 #include <string.h>
+#include <sys/sysmacros.h>
+#include <linux/major.h>
 #include "parse.h"
 #include "driveprm.h"
 #include "driveprmP.h"
@@ -137,12 +136,12 @@ static int getdrivenum(int fd, struct st
 	}
 
 	if (!S_ISBLK(buf->st_mode) || 
-	    MAJOR(buf->st_rdev) != FLOPPY_MAJOR) {
+	    major(buf->st_rdev) != FLOPPY_MAJOR) {
 		fprintf(stderr,"Not a floppy drive\n");
 		exit(1);
 	}
 	
-	num = MINOR( buf->st_rdev );
+	num = minor( buf->st_rdev );
 	return (num & 3) + ((num & 0x80) >> 5);
 }
 
Only in fdutils-5.3/src: fdmount
diff -upr clean/fdutils-5.3/src/fdmount.c fdutils-5.3/src/fdmount.c
--- clean/fdutils-5.3/src/fdmount.c	Sun May 27 14:11:49 2001
+++ fdutils-5.3/src/fdmount.c	Sun May 27 14:04:47 2001
@@ -12,9 +12,11 @@
 #include <sys/ioctl.h>
 #include <sys/mount.h>
 #include <linux/fd.h>
-#include <linux/fs.h>
-#include <linux/minix_fs.h>
 #include <string.h>
+#include <limits.h>
+
+#include <linux/types.h>
+#include <linux/minix_fs.h>
 
 #ifdef HAVE_LINUX_EXT_FS_H
 #include <linux/ext_fs.h>
Only in fdutils-5.3/src: fdrawcmd
Only in fdutils-5.3/src: fdrawcmd.o
Only in fdutils-5.3/src: floppycontrol
Only in fdutils-5.3/src: floppycontrol.o
Only in fdutils-5.3/src: floppymeter
diff -upr clean/fdutils-5.3/src/floppymeter.c fdutils-5.3/src/floppymeter.c
--- clean/fdutils-5.3/src/floppymeter.c	Sun May 27 14:11:49 2001
+++ fdutils-5.3/src/floppymeter.c	Sun May 27 14:06:41 2001
@@ -8,7 +8,7 @@
 #include <sys/time.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <linux/fs.h>
+#include <sys/sysmacros.h>
 #include <linux/major.h>
 #include <getopt.h>
 #include <string.h>
@@ -161,11 +161,11 @@ void main(int argc, char **argv)
 		perror("fstat");
 		exit(1);
 	}
-	if (!S_ISBLK(buf.st_mode) || MAJOR(buf.st_rdev) != FLOPPY_MAJOR) {
+	if (!S_ISBLK(buf.st_mode) || major(buf.st_rdev) != FLOPPY_MAJOR) {
 		fprintf(stderr,"%s is not a floppy drive\n", name);
 		exit(1);
 	}
-	dn = MINOR( buf.st_rdev );
+	dn = minor( buf.st_rdev );
 	dn = (dn & 3) + ((dn & 0x80) >> 5);
 
 	if(ioctl(fd, FDGETDRVPRM, &dpr) < 0) {
Only in fdutils-5.3/src: floppymeter.o
Only in fdutils-5.3/src: getfdprm
Only in fdutils-5.3/src: getfdprm.o
Only in fdutils-5.3/src: libfdutils.a
diff -upr clean/fdutils-5.3/src/measure.c fdutils-5.3/src/measure.c
--- clean/fdutils-5.3/src/measure.c	Sun May 27 14:11:49 2001
+++ fdutils-5.3/src/measure.c	Sun May 27 13:20:27 2001
@@ -8,8 +8,6 @@
 #include <sys/time.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <linux/fs.h>
-#include <linux/major.h>
 #include <getopt.h>
 #include <string.h>
 #include "enh_options.h"
Only in fdutils-5.3/src: setfdprm
Only in fdutils-5.3/src: superformat
diff -upr clean/fdutils-5.3/src/superformat.c fdutils-5.3/src/superformat.c
--- clean/fdutils-5.3/src/superformat.c	Sun May 27 14:11:49 2001
+++ fdutils-5.3/src/superformat.c	Sun May 27 13:46:58 2001
@@ -36,8 +36,7 @@ Todo:
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <linux/fs.h>
-#include <linux/major.h>
+#include <sys/sysmacros.h>
 #include <string.h>
 #include <errno.h>
 #include "enh_options.h"
@@ -707,7 +706,7 @@ int main(int argc, char **argv)
 		fd[0].drive = drivedesc.drivenum;
 		fd[0].drvprm = drivedesc.drvprm;
 
-		if(MINOR(drivedesc.buf.st_rdev) & 0x7c) {
+		if(minor(drivedesc.buf.st_rdev) & 0x7c) {
 			if(fd[0].name == drivename) {
 				fprintf(stderr,
 					"%s has bad minor/major numbers\n",
Only in fdutils-5.3/src: superformat.o
Only in fdutils-5.3/src: xdfcopy
diff -upr clean/fdutils-5.3/src/xdfcopy.c fdutils-5.3/src/xdfcopy.c
--- clean/fdutils-5.3/src/xdfcopy.c	Sun May 27 14:11:49 2001
+++ fdutils-5.3/src/xdfcopy.c	Sun May 27 14:01:34 2001
@@ -5,15 +5,13 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <linux/fd.h>
 #include <linux/fdreg.h>
 #include <sys/ioctl.h>
-#include <sys/time.h>
 #include <fcntl.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <linux/major.h>
-#include <linux/fs.h>
 #include <string.h>
 #include <sys/time.h>
 #include <errno.h>
@@ -516,10 +514,10 @@ static int get_type(int fd)
    exit(0);
  }
  
- if (!S_ISBLK(statbuf.st_mode) && MAJOR(statbuf.st_rdev) != FLOPPY_MAJOR)
+ if (!S_ISBLK(statbuf.st_mode) && major(statbuf.st_rdev) != FLOPPY_MAJOR)
    return -1;
 
- drive = MINOR( statbuf.st_rdev );
+ drive = minor( statbuf.st_rdev );
  return (drive & 3) + ((drive & 0x80) >> 5);
 }
 


Attachment: pgpgUqknbJAzd.pgp
Description: PGP signature


Reply to: