Sisyphus repository
Last update: 2 february 2023 | SRPMs: 18159 | Visits: 26618165
en ru br
ALT Linux repos
S:4.2-alt2
5.0: 2.11-alt5
4.1: 2.11-alt4
4.0: 2.11-alt4
3.0: 2.11-alt3

Group :: File tools
RPM: dosfstools

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: dosfstools-2.11-alt-types.patch
Download


diff -Naur dosfstools-2.11.orig/dosfsck/boot.c dosfstools-2.11/dosfsck/boot.c
--- dosfstools-2.11.orig/src/boot.c	2005-03-12 17:16:22 +0300
+++ dosfstools-2.11/src/boot.c	2005-04-14 17:15:13 +0400
@@ -19,7 +19,7 @@
     /* don't divide by zero */
 
 static struct {
-    __u8 media;
+    u_int8_t media;
     char *descr;
 } mediabytes[] = {
     { 0xf0, "5.25\" or 3.5\" HD floppy" },
@@ -151,18 +151,18 @@
     fs_read(fs->backupboot_start,sizeof(b2),&b2);
     if (memcmp(b,&b2,sizeof(b2)) != 0) {
 	/* there are any differences */
-	__u8 *p, *q;
+	u_int8_t *p, *q;
 	int i, pos, first = 1;
 	char buf[20];
 
 	printf( "There are differences between boot sector and its backup.\n" );
 	printf( "Differences: (offset:original/backup)\n  " );
 	pos = 2;
-	for( p = (__u8 *)b, q = (__u8 *)&b2, i = 0; i < sizeof(b2);
+	for( p = (u_int8_t *)b, q = (u_int8_t *)&b2, i = 0; i < sizeof(b2);
 	     ++p, ++q, ++i ) {
 	    if (*p != *q) {
 		sprintf( buf, "%s%u:%02x/%02x", first ? "" : ", ",
-			 (unsigned)(p-(__u8 *)b), *p, *q );
+			 (unsigned)(p-(u_int8_t *)b), *p, *q );
 		if (pos + strlen(buf) > 78) printf( "\n  " ), pos = 2;
 		printf( "%s", buf );
 		pos += strlen(buf);
@@ -210,7 +210,7 @@
 	if (interactive && get_key("12","?") == '1') {
 	    /* search for a free reserved sector (not boot sector and not
 	     * backup boot sector) */
-	    __u32 s;
+	    u_int32_t s;
 	    for( s = 1; s < CF_LE_W(b->reserved); ++s )
 		if (s != CF_LE_W(b->backup_boot)) break;
 	    if (s > 0 && s < CF_LE_W(b->reserved)) {
diff -Naur dosfstools-2.11.orig/dosfsck/dosfsck.h dosfstools-2.11/dosfsck/dosfsck.h
--- dosfstools-2.11.orig/src/dosfsck.h	2005-03-12 17:23:12 +0300
+++ dosfstools-2.11/src/dosfsck.h	2005-04-14 17:15:13 +0400
@@ -47,58 +47,58 @@
 /* ++roman: Use own definition of boot sector structure -- the kernel headers'
  * name for it is msdos_boot_sector in 2.0 and fat_boot_sector in 2.1 ... */
 struct boot_sector {
-    __u8	ignored[3];	/* Boot strap short or near jump */
-    __u8	system_id[8];	/* Name - can be used to special case
+    u_int8_t	ignored[3];	/* Boot strap short or near jump */
+    u_int8_t	system_id[8];	/* Name - can be used to special case
 				   partition manager volumes */
-    __u8	sector_size[2];	/* bytes per logical sector */
-    __u8	cluster_size;	/* sectors/cluster */
-    __u16	reserved;	/* reserved sectors */
-    __u8	fats;		/* number of FATs */
-    __u8	dir_entries[2];	/* root directory entries */
-    __u8	sectors[2];	/* number of sectors */
-    __u8	media;		/* media code (unused) */
-    __u16	fat_length;	/* sectors/FAT */
-    __u16	secs_track;	/* sectors per track */
-    __u16	heads;		/* number of heads */
-    __u32	hidden;		/* hidden sectors (unused) */
-    __u32	total_sect;	/* number of sectors (if sectors == 0) */
+    u_int8_t	sector_size[2];	/* bytes per logical sector */
+    u_int8_t	cluster_size;	/* sectors/cluster */
+    u_int16_t	reserved;	/* reserved sectors */
+    u_int8_t	fats;		/* number of FATs */
+    u_int8_t	dir_entries[2];	/* root directory entries */
+    u_int8_t	sectors[2];	/* number of sectors */
+    u_int8_t	media;		/* media code (unused) */
+    u_int16_t	fat_length;	/* sectors/FAT */
+    u_int16_t	secs_track;	/* sectors per track */
+    u_int16_t	heads;		/* number of heads */
+    u_int32_t	hidden;		/* hidden sectors (unused) */
+    u_int32_t	total_sect;	/* number of sectors (if sectors == 0) */
     
     /* The following fields are only used by FAT32 */
-    __u32	fat32_length;	/* sectors/FAT */
-    __u16	flags;		/* bit 8: fat mirroring, low 4: active fat */
-    __u8	version[2];	/* major, minor filesystem version */
-    __u32	root_cluster;	/* first cluster in root directory */
-    __u16	info_sector;	/* filesystem info sector */
-    __u16	backup_boot;	/* backup boot sector */
-    __u16	reserved2[6];	/* Unused */
+    u_int32_t	fat32_length;	/* sectors/FAT */
+    u_int16_t	flags;		/* bit 8: fat mirroring, low 4: active fat */
+    u_int8_t	version[2];	/* major, minor filesystem version */
+    u_int32_t	root_cluster;	/* first cluster in root directory */
+    u_int16_t	info_sector;	/* filesystem info sector */
+    u_int16_t	backup_boot;	/* backup boot sector */
+    u_int16_t	reserved2[6];	/* Unused */
 
     /* fill up to 512 bytes */
-    __u8	junk[448];
+    u_int8_t	junk[448];
 } __attribute__ ((packed));
 
 struct info_sector {
-    __u32	magic;		/* Magic for info sector ('RRaA') */
-    __u8	junk[0x1dc];
-    __u32	reserved1;	/* Nothing as far as I can tell */
-    __u32	signature;	/* 0x61417272 ('rrAa') */
-    __u32	free_clusters;	/* Free cluster count.  -1 if unknown */
-    __u32	next_cluster;	/* Most recently allocated cluster. */
-    __u32	reserved2[3];
-    __u16	reserved3;
-    __u16	boot_sign;
+    u_int32_t	magic;		/* Magic for info sector ('RRaA') */
+    u_int8_t	junk[0x1dc];
+    u_int32_t	reserved1;	/* Nothing as far as I can tell */
+    u_int32_t	signature;	/* 0x61417272 ('rrAa') */
+    u_int32_t	free_clusters;	/* Free cluster count.  -1 if unknown */
+    u_int32_t	next_cluster;	/* Most recently allocated cluster. */
+    u_int32_t	reserved2[3];
+    u_int16_t	reserved3;
+    u_int16_t	boot_sign;
 };
 
 typedef struct {
-    __u8	name[8],ext[3];	/* name and extension */
-    __u8	attr;		/* attribute bits */
-    __u8	lcase;		/* Case for base and extension */
-    __u8	ctime_ms;	/* Creation time, milliseconds */
-    __u16	ctime;		/* Creation time */
-    __u16	cdate;		/* Creation date */
-    __u16	adate;		/* Last access date */
-    __u16	starthi;	/* High 16 bits of cluster in FAT32 */
-    __u16	time,date,start;/* time, date and first cluster */
-    __u32	size;		/* file size (in bytes) */
+    u_int8_t	name[8],ext[3];	/* name and extension */
+    u_int8_t	attr;		/* attribute bits */
+    u_int8_t	lcase;		/* Case for base and extension */
+    u_int8_t	ctime_ms;	/* Creation time, milliseconds */
+    u_int16_t	ctime;		/* Creation time */
+    u_int16_t	cdate;		/* Creation date */
+    u_int16_t	adate;		/* Last access date */
+    u_int16_t	starthi;	/* High 16 bits of cluster in FAT32 */
+    u_int16_t	time,date,start;/* time, date and first cluster */
+    u_int32_t	size;		/* file size (in bytes) */
 } DIR_ENT;
 
 typedef struct _dos_file {
diff -Naur dosfstools-2.11.orig/dosfsck/lfn.c dosfstools-2.11/dosfsck/lfn.c
--- dosfstools-2.11.orig/src/lfn.c	2005-03-12 18:05:44 +0300
+++ dosfstools-2.11/src/lfn.c	2005-04-14 17:15:13 +0400
@@ -15,14 +15,14 @@
 #include "file.h"
 
 typedef struct {
-	__u8    id;		/* sequence number for slot */
-	__u8    name0_4[10];	/* first 5 characters in name */
-	__u8    attr;		/* attribute byte */
-	__u8    reserved;	/* always 0 */
-	__u8    alias_checksum;	/* checksum for 8.3 alias */
-	__u8    name5_10[12];	/* 6 more characters in name */
-	__u16   start;		/* starting cluster number, 0 in long slots */
-	__u8    name11_12[4];	/* last 2 characters in name */
+	u_int8_t    id;		/* sequence number for slot */
+	u_int8_t    name0_4[10];	/* first 5 characters in name */
+	u_int8_t    attr;		/* attribute byte */
+	u_int8_t    reserved;	/* always 0 */
+	u_int8_t    alias_checksum;	/* checksum for 8.3 alias */
+	u_int8_t    name5_10[12];	/* 6 more characters in name */
+	u_int16_t   start;		/* starting cluster number, 0 in long slots */
+	u_int8_t    name11_12[4];	/* last 2 characters in name */
 } LFN_ENT;
 
 #define LFN_ID_START	0x40
@@ -357,7 +357,7 @@
 char *lfn_get( DIR_ENT *de )
 {
     char *lfn;
-    __u8 sum;
+    u_int8_t sum;
     int i;
     
     if (de->attr == VFAT_LN_ATTR)
@@ -401,7 +401,7 @@
 		return NULL;
 	      case '3':
 		for( i = 0; i < lfn_parts; ++i ) {
-		    __u8 id = (lfn_parts-i) | (i==0 ? LFN_ID_START : 0);
+		    u_int8_t id = (lfn_parts-i) | (i==0 ? LFN_ID_START : 0);
 		    fs_write( lfn_offsets[i]+offsetof(LFN_ENT,id),
 			      sizeof(id), &id );
 		}
diff -Naur dosfstools-2.11.orig/mkdosfs/mkdosfs.c dosfstools-2.11/mkdosfs/mkdosfs.c
--- dosfstools-2.11.orig/src/mkdosfs.c	2005-04-14 17:18:16 +0400
+++ dosfstools-2.11/src/mkdosfs.c	2005-04-14 17:10:47 +0400
@@ -179,74 +179,74 @@
  * alignments */
 
 struct msdos_volume_info {
-  __u8		drive_number;	/* BIOS drive number */
-  __u8		RESERVED;	/* Unused */
-  __u8		ext_boot_sign;	/* 0x29 if fields below exist (DOS 3.3+) */
-  __u8		volume_id[4];	/* Volume ID number */
-  __u8		volume_label[11];/* Volume label */
-  __u8		fs_type[8];	/* Typically FAT12 or FAT16 */
+  u_int8_t		drive_number;	/* BIOS drive number */
+  u_int8_t		RESERVED;	/* Unused */
+  u_int8_t		ext_boot_sign;	/* 0x29 if fields below exist (DOS 3.3+) */
+  u_int8_t		volume_id[4];	/* Volume ID number */
+  u_int8_t		volume_label[11];/* Volume label */
+  u_int8_t		fs_type[8];	/* Typically FAT12 or FAT16 */
 } __attribute__ ((packed));
 
 struct msdos_boot_sector
 {
-  __u8	        boot_jump[3];	/* Boot strap short or near jump */
-  __u8          system_id[8];	/* Name - can be used to special case
+  u_int8_t	    boot_jump[3];	/* Boot strap short or near jump */
+  u_int8_t          system_id[8];	/* Name - can be used to special case
 				   partition manager volumes */
-  __u8          sector_size[2];	/* bytes per logical sector */
-  __u8          cluster_size;	/* sectors/cluster */
-  __u16         reserved;	/* reserved sectors */
-  __u8          fats;		/* number of FATs */
-  __u8          dir_entries[2];	/* root directory entries */
-  __u8          sectors[2];	/* number of sectors */
-  __u8          media;		/* media code (unused) */
-  __u16         fat_length;	/* sectors/FAT */
-  __u16         secs_track;	/* sectors per track */
-  __u16         heads;		/* number of heads */
-  __u32         hidden;		/* hidden sectors (unused) */
-  __u32         total_sect;	/* number of sectors (if sectors == 0) */
+  u_int8_t          sector_size[2];	/* bytes per logical sector */
+  u_int8_t          cluster_size;	/* sectors/cluster */
+  u_int16_t         reserved;	/* reserved sectors */
+  u_int8_t          fats;		/* number of FATs */
+  u_int8_t          dir_entries[2];	/* root directory entries */
+  u_int8_t          sectors[2];	/* number of sectors */
+  u_int8_t          media;		/* media code (unused) */
+  u_int16_t         fat_length;	/* sectors/FAT */
+  u_int16_t         secs_track;	/* sectors per track */
+  u_int16_t         heads;		/* number of heads */
+  u_int32_t         hidden;		/* hidden sectors (unused) */
+  u_int32_t         total_sect;	/* number of sectors (if sectors == 0) */
   union {
     struct {
       struct msdos_volume_info vi;
-      __u8	boot_code[BOOTCODE_SIZE];
+      u_int8_t	boot_code[BOOTCODE_SIZE];
     } __attribute__ ((packed)) _oldfat;
     struct {
-      __u32	fat32_length;	/* sectors/FAT */
-      __u16	flags;		/* bit 8: fat mirroring, low 4: active fat */
-      __u8	version[2];	/* major, minor filesystem version */
-      __u32	root_cluster;	/* first cluster in root directory */
-      __u16	info_sector;	/* filesystem info sector */
-      __u16	backup_boot;	/* backup boot sector */
-      __u16	reserved2[6];	/* Unused */
+      u_int32_t	fat32_length;	/* sectors/FAT */
+      u_int16_t	flags;		/* bit 8: fat mirroring, low 4: active fat */
+      u_int8_t	version[2];	/* major, minor filesystem version */
+      u_int32_t	root_cluster;	/* first cluster in root directory */
+      u_int16_t	info_sector;	/* filesystem info sector */
+      u_int16_t	backup_boot;	/* backup boot sector */
+      u_int16_t	reserved2[6];	/* Unused */
       struct msdos_volume_info vi;
-      __u8	boot_code[BOOTCODE_FAT32_SIZE];
+      u_int8_t	boot_code[BOOTCODE_FAT32_SIZE];
     } __attribute__ ((packed)) _fat32;
   } __attribute__ ((packed)) fstype;
-  __u16		boot_sign;
+  u_int16_t		boot_sign;
 } __attribute__ ((packed));
 #define fat32	fstype._fat32
 #define oldfat	fstype._oldfat
 
 struct fat32_fsinfo {
-  __u32		reserved1;	/* Nothing as far as I can tell */
-  __u32		signature;	/* 0x61417272L */
-  __u32		free_clusters;	/* Free cluster count.  -1 if unknown */
-  __u32		next_cluster;	/* Most recently allocated cluster.
+  u_int32_t		reserved1;	/* Nothing as far as I can tell */
+  u_int32_t		signature;	/* 0x61417272L */
+  u_int32_t		free_clusters;	/* Free cluster count.  -1 if unknown */
+  u_int32_t		next_cluster;	/* Most recently allocated cluster.
 				 * Unused under Linux. */
-  __u32		reserved2[4];
+  u_int32_t		reserved2[4];
 };
 
 struct msdos_dir_entry
   {
     char	name[8], ext[3];	/* name and extension */
-    __u8        attr;			/* attribute bits */
-    __u8	lcase;			/* Case for base and extension */
-    __u8	ctime_ms;		/* Creation time, milliseconds */
-    __u16	ctime;			/* Creation time */
-    __u16	cdate;			/* Creation date */
-    __u16	adate;			/* Last access date */
-    __u16	starthi;		/* high 16 bits of first cl. (FAT32) */
-    __u16	time, date, start;	/* time, date and first cluster */
-    __u32	size;			/* file size (in bytes) */
+    u_int8_t    attr;			/* attribute bits */
+    u_int8_t	lcase;			/* Case for base and extension */
+    u_int8_t	ctime_ms;		/* Creation time, milliseconds */
+    u_int16_t	ctime;			/* Creation time */
+    u_int16_t	cdate;			/* Creation date */
+    u_int16_t	adate;			/* Last access date */
+    u_int16_t	starthi;		/* high 16 bits of first cl. (FAT32) */
+    u_int16_t	time, date, start;	/* time, date and first cluster */
+    u_int32_t	size;			/* file size (in bytes) */
   } __attribute__ ((packed));
 
 /* The "boot code" we put into the filesystem... it writes a message and
@@ -909,7 +909,7 @@
     bs.hidden = CT_LE_L(hidden_sectors);
   else {
     /* In Atari format, hidden is a 16 bit field */
-    __u16 hidden = CT_LE_W(hidden_sectors);
+    u_int16_t hidden = CT_LE_W(hidden_sectors);
     if (hidden_sectors & ~0xffff)
       die("#hidden doesn't fit in 16bit field of Atari format\n");
     memcpy( &bs.hidden, &hidden, 2 );
@@ -1317,7 +1317,7 @@
     info->next_cluster = CT_LE_L(2);
 
     /* Info sector also must have boot sign */
-    *(__u16 *)(info_sector + 0x1fe) = CT_LE_W(BOOT_SIGN);
+    *(u_int16_t *)(info_sector + 0x1fe) = CT_LE_W(BOOT_SIGN);
   }
   
   if (!(blank_sector = malloc( sector_size )))
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin