Commit Graph

57 Commits

Author SHA1 Message Date
Sami Kerola cd2a6f1cfd rpmatch: use symbolic value when evaluation return codes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-24 12:42:06 +01:00
Sami Kerola 730ae9c899 fsck.minix: fix segmentation fault
Return from check_file() and check_file2() functions when maximum name
depth is reached.  The use unsafe strncpy() is also removed just to be on
safe side.

Addresses: https://bugs.debian.org/773892
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 10:14:13 +01:00
Benno Schulenberg 451dbcfae1 textual: add a docstring to most of the utilities
This adds a concise description of a tool to its usage text.

A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:27:38 +01:00
Sami Kerola 564dd4af5d fsck.minix: check writing to a file descriptor was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:07 +02:00
Sami Kerola 3acc206d39 various: fix variable and function declarations [smatch scan]
disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code
fdisks/sfdisk.c:982:5: warning: mixing declarations and code
fdisks/sfdisk.c:1254:5: warning: mixing declarations and code
fdisks/sfdisk.c:1564:5: warning: mixing declarations and code
lib/mbsalign.c:279:7: warning: mixing declarations and code
libblkid/src/devname.c:378:17: warning: mixing declarations and code
libfdisk/src/alignment.c:219:9: warning: mixing declarations and code
term-utils/wall.c:111:9: warning: mixing declarations and code
text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks'
text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line'
text-utils/rev.c:105:9: warning: mixing declarations and code
text-utils/tailf.c:245:9: warning: mixing declarations and code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:20 +02:00
William Pitcock 51924a4ef0 add missing rpmatch.h everywhere it needs to be
Signed-off-by: William Pitcock <nenolod@dereferenced.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-02-20 13:04:02 +01:00
Benno Schulenberg b50945d4ac textual: spell and encode the name of Arkadiusz Miśkiewicz correctly
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-02-06 11:15:02 +01:00
Benno Schulenberg 0c6625a15d textual: standardize the reporting of program name plus package version
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-01-30 15:24:00 +01:00
Karel Zak 248b8101a0 mkfs.minix: fsck:minix: fix compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-12-20 20:01:35 +01:00
Sami Kerola 65ca6f8382 minix: replace magic constants with macro names
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:38:56 +01:00
Sami Kerola a180dc6c54 minix: use off_t, size_t, etc appropriate types
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-12-19 11:38:53 +01:00
Sami Kerola 289dcc9023 translation: unify file open error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +02:00
Petr Uzel e12c9866b5 include: rename writeall.h to all-io.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-15 11:32:27 +02:00
Petr Uzel 28d4cdcb9d fsck.minix.c: fix compiler warnings [-Wunused-result]
fsck.minix.c: In function ‘ask’:
fsck.minix.c:263:7: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:46 +02:00
Sami Kerola 45ca68ece7 disk-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 20:04:39 +02:00
Sami Kerola 2a11944f16 fsck.minix: fix printf format warning
fsck.minix.c:1302:3: warning: ISO C does not support the '%m' gnu_printf format [-Wformat]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola a2bfda30ba fsck.minix: clean up coding style
$ indent -linux -psl -blf disk-utils/fsck.minix.c

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 78ecf61b0e fsck.minix: align with howto-usage-function.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola d4a573bc7b fsck.minix: use rpmatch() for yes/no question
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Sami Kerola 891327c091 fsck.minix: use symbolic exit codes
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-30 16:48:12 +02:00
Francesco Cosoleto f8209a0f66 fsck.minix: fix zone_map memory allocation failure check
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2011-11-10 12:58:31 +01:00
Francesco Cosoleto d73af2ac4b fsck.minix: remove unnecessary memset calls
The program aborts without using this unintialized allocated memory,
setting to zero doesn't look needed.

memset calls with sizeof() of pointer as argument (reported by clang).

[kzak@redhat.com: - replace malloc with calloc for {zone,inode}_count
                    to make code more robust]

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-09 10:03:07 +01:00
Petr Uzel 960cf5737e misc: use %m in format string instead of %s and strerror(errno)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-09-27 15:46:07 +02:00
Karel Zak 832410da7b mkfs.minix: fix write_all() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-17 00:29:39 +02:00
Karel Zak ab1c86fc53 fsck.minix: fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01 14:38:42 +02:00
Karel Zak 06c0375ce3 fsck.minix: fix "array subscript is above array bounds"
fsck.minix.c: In function ‘map_block2’:
fsck.minix.c:486:9: warning: array subscript is above array bounds [-Warray-bounds]

The 'blknr' has to be bigger than 7 + 256 + (256 * 256) for i_zone[9].

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 13:00:40 +02:00
Karel Zak 0dca7bd54a minix: remove unnecessary initializations
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:41:25 +02:00
Karel Zak c1d26b1981 minix: add MINIX_ prefix to some global macros
... and remove some tailing whitespaces.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:23:01 +02:00
Karel Zak 058cda4c1d minix: cleanup global variables and macros
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-21 12:13:33 +02:00
Sami Kerola 7cc112d927 minix: move globals and inline functions to minix_programs.h
Global variables and inline functions are moved from minix.h to
minix_programs.h which is included in mkfs.minix and fsck.minix.
The minix.h will have only struct definitions etc generic
contents which is reasonable to share with utilities and
libraries.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 20:43:16 +02:00
Sami Kerola 63883af765 libblkid: use MINIX_BLOCK_SIZE from minix.h
In the minix.h two definitions where renamed, so that the single
definition is reusable in fsck.minix, mkfs.minix and libblkid.

BLOCK_SIZE_BITS -> MINIX_BLOCK_SIZE_BITS
BLOCK_SIZE      -> MINIX_BLOCK_SIZE

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-07-20 20:13:08 +02:00
Karel Zak 5bd223a04a fsck.minix: remove unused variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-14 17:10:53 +02:00
Davidlohr Bueso 971b7341d6 fsck.minix: use common functionalitly
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-06-02 13:27:24 +02:00
Karel Zak c0f6d6d0c4 fsck.minix: use lib/ismounted.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-11 14:15:47 +01:00
Karel Zak c326060c2f fsck.minix: fix strict-aliasing bugs
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-17 00:19:23 +02:00
Karel Zak e98754d6bb fsck.minix: fix broken zone checking
This bug has been introduced by commit
95356e8b74.

The fsck.minix code assumes that isset() macro returns boolean,
unfortunately the generic implementation from libc returns integer.

This patch also add a fallback for the bitmap macros to include/bitops.h.

Reported-by: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-10-15 14:14:32 +02:00
Guillem Jover e79829db46 build-sys: detect if volatile is available
Do not defined volatile away on non-Linux systems, detect its presence
using AC_C_VOLATILE instead.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
2009-10-09 14:57:48 +02:00
Karel Zak 95356e8b74 mkfs.minix: remove local implementation of {set,clr}bit
We needn't to duplicate stuff from <sys/param.h>.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-05 15:47:30 +00:00
Karel Zak 727b3c2f26 mkfs.minix: (and fsck) rename bitops.h
This patch renames bitops.h to minix_bitops.h to avoid possible
collisions with global include/bitops.h file.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-05 14:38:54 +01:00
maximilian attems fc68cd4973 disk-utils: s/MOUNTED/_PATH_MOUNTED/
no longer use deprecated alias.
helps compiling util-linux-ng against klibc.

add pathnames.h include, where _PATH_MOUNTED is defined.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:06:07 +02:00
James Youngman 54a78201e1 fsck.minix: reset the terminal state if we are killed by a fatal signal
[kzak@redhat.com: remove unnecessary volatile type qualifier]
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08 02:16:20 +02:00
James Youngman bb98388557 fsck.minix: correct the error message given when we can't open the device
Don't actually print %s in the error message, print the device name,
as was obviously intended.  Also, print the error message
corresponding to the errno value.

[kzak@redhat.com: add __attribute__, coding style cleanups]
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08 01:42:36 +02:00
Benno Schulenberg 65b27d3669 po: gettextizing some overlooked messages.
Gettextize three new strings, make two strings indentical to two others,
and gettextize three strings that are already gettextized elsewhere.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-08-14 14:46:28 +02:00
Karel Zak baf39af15b Imported from util-linux-2.13-pre2 tarball. 2006-12-07 00:26:58 +01:00
Karel Zak 48d7b13a1e Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
Karel Zak c129767e06 Imported from util-linux-2.12b tarball. 2006-12-07 00:26:16 +01:00
Karel Zak 612721dba8 Imported from util-linux-2.11n tarball. 2006-12-07 00:25:52 +01:00
Karel Zak e8f2641919 Imported from util-linux-2.11m tarball. 2006-12-07 00:25:49 +01:00
Karel Zak 364cda4857 Imported from util-linux-2.11f tarball. 2006-12-07 00:25:48 +01:00
Karel Zak c07ebfa1e0 Imported from util-linux-2.11b tarball. 2006-12-07 00:25:46 +01:00