Commit Graph

48 Commits

Author SHA1 Message Date
Jaakko Heinonen
2923ae8a85 Print a newline after the error message.
PR:		bin/168447
Submitted by:	Boris Kochergin
2012-11-03 09:18:37 +00:00
Ulrich Spörlein
3bbc4438c9 Make fsck and fsck_msdosfs WARNS=6 clean
- sprinkle const
- add volatile qualifier to avoid vfork clobbering

Inspired by:	NetBSD
PR:		bin/139802
Reviewed by:	ed
2012-10-21 12:01:19 +00:00
Ulrich Spörlein
6cf357bc6c sbin/fsck: s/perror/perr/ to avoid shadowing
- rename some other vars too
- merge NetBSD license changes

Obtained from:	NetBSD
PR:		bin/139802
Reviewed by:	ed
2012-10-21 12:01:11 +00:00
Kevin Lo
544c5e5b53 Make sure that each va_start has one and only one matching va_end,
especially in error cases.
2012-05-29 01:48:06 +00:00
Ed Schouten
1efe3c6b58 Add missing static keywords for global variables to tools in sbin/.
These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.
2011-11-04 13:36:02 +00:00
Brian Somers
48790afa7b Fix some style(9), although there's a lot more issues here.
Fix some casting errors.

PR:		142384
Submitted by:	giffunip at tutopia dot com
Obtained from:	NetBSD
MFC after:	3 weeks
2010-06-20 09:40:54 +00:00
Ulrich Spörlein
30fc54ea79 mdoc: .Ud has attitude, it takes no argument! 2010-05-27 13:56:40 +00:00
Konstantin Belousov
75fb535394 Rename fields to match better the msdosfs headers. This work is still
incomplete as some info doesn't really belong to the structs where it is
defined.

Submitted by:	Pedro F. Giffuni <giffunip tutopia com>
Reviewed by:	bde
MFC after:	2 weeks
2010-02-14 12:31:28 +00:00
Konstantin Belousov
6069db97f6 Bug fixes from NetBSD
- fix sign-compare issues.
- ANSIfy a couple of functions.
- Remove more duplicate #includes.
- Memory leak found by Coverity on NetBSD.

Submitted by:	Pedro F. Giffuni <giffunip tutopia com>
Reviewed by:	bde
MFC after:	2 weeks
2010-02-14 12:30:30 +00:00
Konstantin Belousov
a1882ff2a2 License changes from NetBSD.
Move to 2 clause license, approved by Wolfgang Solfrank.

Submitted by:	Pedro F. Giffuni <giffunip tutopia com>
MFC after:	2 weeks
2010-02-14 12:28:43 +00:00
Andriy Gapon
6f81b90ff5 fsck_msdosfs: accept no-op -C option for compatibilty with fsck
Submitted by:	marck
Reviewed by:	current@
Approved by:	jhb (mentor)
MFC after:	1 week
2009-06-10 19:02:54 +00:00
Yaroslav Tykhiy
bb0e602de4 Spot two more bugs WRT adherence to the local prompt style. 2008-01-31 13:22:13 +00:00
Yaroslav Tykhiy
dc401d4927 Use consistent style in user prompts: the question is in a new line
and begins with a capital letter.  The rest of pwarn/ask pairs here
follows this style.

Requested by:	bde
2008-01-31 13:16:29 +00:00
Yaroslav Tykhiy
38281b6601 Prevent the `fix?' question from running together
with the problem description on the terminal: use
conventional punctuation.
2008-01-13 07:56:36 +00:00
Stefan Farfeleder
4eb55c7adc Prefer the __printflike() macro to GCC's __attribute__ stuff. 2005-03-09 10:10:51 +00:00
Ruslan Ermilov
96994dec73 Sync program's usage() with manpage's SYNOPSIS. 2005-02-10 09:39:51 +00:00
Ruslan Ermilov
6087df9e8b Sort sections. 2005-01-18 10:09:38 +00:00
Ruslan Ermilov
d04b5dfe6c Assorted markup, grammar, and spelling fixes. 2004-05-17 08:35:43 +00:00
Tim J. Robbins
4029695dbf Only compare the interesting part of the bootblock with its backup.
Allow check to proceed with bad backup boot block if we're doing a
readonly check. Various typos in comments.

Obtained from:	NetBSD
2004-04-20 11:41:57 +00:00
Johan Karlsson
604d24db95 style.Makefile(5):
Use WARNS?= instead of WARNS=.
2004-02-23 20:25:27 +00:00
Bruce Evans
ae62d94069 Fixed operation of -f to match its documentation and fsck_ffs. It
has now has no effect except in combination with -p, and plain fsck
checks all file systems instead of skipping clean ones for msdosfs
only.

Renamed the force flag to skipclean and inverted its logic as in
fsck_ffs.
2004-02-05 15:47:46 +00:00
Bruce Evans
910da6c689 Fixed some bugs in checkdirty(). The check for the clean bit was
combined with the the signature check in a wrong way (basically
(dirty:= signature_recognised() && !clean) instead of
(mightbedirty:= !signature_recognized || !clean), so file systems
with unrecognized signatures were considered clean.  Many of the
don't-care and reserved bits were not ignored, so some file systems
with valid signatures were unrecognized.  One of my FAT32 file systems
has a signature of f8,ff,ff,ff,ff,ff,ff,f7 when dirty, but only
f8,ff,ff,0f,ff,ff,ff,07 was recognised as dirty for FAT32, so the
fail-unsafeness made my file system always considered clean.

Check the i/o non-error bit in checkdirty().  Its absence would give
an unrecognized signature in code that is unaware of it, but we now
mask it out of the signature so we have to check it explicitly.  This
combines naturally with the check of the clean bit.

Reviewed by:	rnordier (except for final details)
2004-02-05 15:18:18 +00:00
Bruce Evans
8e9c564a11 Document the dirty flag and other bits in the first 2 FAT entries
better.  There is a related I/O error flag which we don't support in
the kernel but must support here.  (Support for bits that we don't
understand here is mostly automatic by fail-safeness, but checkdirty()
has fail-unsafeness.)  There are some reserved and don't-care bits
that weren't fully documented and aren't always masked properly.  The
comment about the bits in readfat() will be removed when the masking
is fixed.

Submitted by:	rnordier
2004-02-05 06:55:12 +00:00
Bruce Evans
a270f31ebd Prepare to fix checkdirty() by moving it from check.c to fat.c. It is
identical to a subset of readfat(), so it belongs near readfat() if not
in it.
2004-02-05 06:32:16 +00:00
Bruce Evans
7e1cecfd0f Oops, highly non-KNF indentation is normal for large expressions in
this program.  Gnu indentation is used for these.  Redo the fix for
the large expression at the end of the previous commit to give gnu
indentation.  The original version was gnuish but had 9 bogus extra
characters of indentation in its continuation lines, perfect tab
lossage on every line, and other bugs.

The previous commit log should have claimed to fix style bugs in the
previous-1 commit (1.5), not the forced null previous commit (1.6).
2003-12-28 01:30:31 +00:00
Bruce Evans
824fd46dca Expanded the comment about the -F flag.
Fixed a nearby style bug (unreachable break).
2003-12-27 14:02:52 +00:00
Bruce Evans
05a8df3c21 fsck_msdosfs/main.c:
- Don't use errexit() to (mis)implement usage().  Using errexit() just
  gave the bogus exit code 8.
- Fixed 3 other style bugs in usage().

fsck/fsutil.[ch]:
- Garbage-collected errexit().  It is essentially just one of NetBSD's
  fsck_ext2fs error printing functions, but we don't have fsck_ext2fs
  and the function is unsuitable for use there too (since pfatal() is
  also used and it printf to a different stream).
2003-12-27 13:08:55 +00:00
Bruce Evans
30b48d7f6d Fixed style bugs in previous commit (unsorting of declarations and poor
wording in a comment).
2003-12-27 06:44:32 +00:00
Bruce Evans
48eb260754 Fixed quoting of `clean'.
Obtained from:	fsck_ffs.8
2003-12-27 06:30:14 +00:00
Bruce Evans
f7bf3122d9 Fixed some style bugs in previous commit (mainly highly non-KNF indentation). 2003-12-27 06:21:44 +00:00
Bruce Evans
ba62a56380 Fixed style bugs in previous commit (unsorting of the global declarations
and addition of a tab to a blank line).
2003-12-27 05:57:20 +00:00
Tom Rhodes
cede1f563c Make msdosfs support the dirty flag in FAT16 and FAT32.
Enable lockf support.

PR:		55861
Submitted by:	Jun Su <junsu@m-net.arbornet.org> (original version)
Reviewed by:	make universe
2003-12-26 17:19:19 +00:00
Tom Rhodes
565e3e6567 In check.c:
Avoid shadowing declarations.
Avoid compairing signed and unsigned types.
2003-10-30 09:08:09 +00:00
Philippe Charnier
2ccd21700b mount_msdos -> mount_msdosfs 2003-06-08 12:53:07 +00:00
Tom Rhodes
5af4935a22 Fix some 'SYNOPSIS' and 'usage' messages. 2002-08-27 00:49:27 +00:00
Tom Rhodes
ce66ddb763 s/filesystem/file system/g as discussed on -developers 2002-08-21 18:11:48 +00:00
Ruslan Ermilov
3ef61a2086 mdoc(7) police: Use the .Ud macro. 2002-08-13 11:47:56 +00:00
Philippe Charnier
e1205e80e5 The .Nm utility 2002-07-06 19:34:18 +00:00
Tom Rhodes
3468b317cb more file system > filesystem 2002-05-16 04:10:46 +00:00
Dag-Erling Smørgrav
d397408818 Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Warner Losh
b70cd7ee68 o __P removed
o ansi function prototypes
o unifdef -D__STDC__
o __dead2 on usage prototype
o remove now-bogus main prototype
2002-03-20 22:57:10 +00:00
David E. O'Brien
2d68bf45bf Default to WARNS=2.
Binary builds that cannot handle this must explicitly set WARNS=0.

Reviewed by:	mike
2001-12-04 02:19:58 +00:00
David E. O'Brien
f5619a236b Document "-F". 2001-07-19 17:06:19 +00:00
David E. O'Brien
a88a254b1a Change exit return value to better match fsck_ffs(8). 2001-07-19 17:06:08 +00:00
David E. O'Brien
c8fb766dde Recognize the "-F" option which requests whether the filesystem needs to
be cleaned immediately in foreground, or if its cleaning can be deferred
to background.

Submitted by:	Maxime Henrion <mux@qualys.com>
2001-07-19 16:45:45 +00:00
Ruslan Ermilov
acc8166aa6 mdoc(7) police: fixed markup and program name. 2001-07-11 08:51:18 +00:00
David E. O'Brien
0120256800 Style tweaks. 2001-07-09 10:38:15 +00:00
David E. O'Brien
0121b42aca Add fsck_msdosfs.
Obtained from:	NetBSD
2001-07-09 10:35:18 +00:00