check.c (102231) | check.c (121726) |
---|---|
1/* 2 * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank 3 * Copyright (c) 1995 Martin Husemann 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 34#include <sys/cdefs.h> 35#ifndef lint 36__RCSID("$NetBSD: check.c,v 1.10 2000/04/25 23:02:51 jdolecek Exp $"); 37static const char rcsid[] = | 1/* 2 * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank 3 * Copyright (c) 1995 Martin Husemann 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 21 unchanged lines hidden (view full) --- 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 34#include <sys/cdefs.h> 35#ifndef lint 36__RCSID("$NetBSD: check.c,v 1.10 2000/04/25 23:02:51 jdolecek Exp $"); 37static const char rcsid[] = |
38 "$FreeBSD: head/sbin/fsck_msdosfs/check.c 102231 2002-08-21 18:11:48Z trhodes $"; | 38 "$FreeBSD: head/sbin/fsck_msdosfs/check.c 121726 2003-10-30 09:08:09Z trhodes $"; |
39#endif /* not lint */ 40 41#include <stdlib.h> 42#include <string.h> 43#include <ctype.h> 44#include <stdio.h> 45#include <unistd.h> 46#include <fcntl.h> 47 48#include "ext.h" 49#include "fsutil.h" 50 51int | 39#endif /* not lint */ 40 41#include <stdlib.h> 42#include <string.h> 43#include <ctype.h> 44#include <stdio.h> 45#include <unistd.h> 46#include <fcntl.h> 47 48#include "ext.h" 49#include "fsutil.h" 50 51int |
52checkfilesys(fname) 53 const char *fname; | 52checkfilesys(const char *fname) |
54{ 55 int dosfs; 56 struct bootblock boot; 57 struct fatEntry *fat = NULL; 58 int i, finish_dosdirsection=0; 59 int mod = 0; 60 int ret = 8; 61 --- 32 unchanged lines hidden (view full) --- 94 95 mod |= readfat(dosfs, &boot, boot.ValidFat >= 0 ? boot.ValidFat : 0, &fat); 96 if (mod & FSFATAL) { 97 close(dosfs); 98 return 8; 99 } 100 101 if (boot.ValidFat < 0) | 53{ 54 int dosfs; 55 struct bootblock boot; 56 struct fatEntry *fat = NULL; 57 int i, finish_dosdirsection=0; 58 int mod = 0; 59 int ret = 8; 60 --- 32 unchanged lines hidden (view full) --- 93 94 mod |= readfat(dosfs, &boot, boot.ValidFat >= 0 ? boot.ValidFat : 0, &fat); 95 if (mod & FSFATAL) { 96 close(dosfs); 97 return 8; 98 } 99 100 if (boot.ValidFat < 0) |
102 for (i = 1; i < boot.FATs; i++) { | 101 for (i = 1; i < (int)boot.FATs; i++) { |
103 struct fatEntry *currentFat; 104 105 mod |= readfat(dosfs, &boot, i, ¤tFat); 106 107 if (mod & FSFATAL) 108 goto out; 109 110 mod |= comparefat(&boot, fat, currentFat, i); --- 84 unchanged lines hidden --- | 102 struct fatEntry *currentFat; 103 104 mod |= readfat(dosfs, &boot, i, ¤tFat); 105 106 if (mod & FSFATAL) 107 goto out; 108 109 mod |= comparefat(&boot, fat, currentFat, i); --- 84 unchanged lines hidden --- |