summaryrefslogtreecommitdiff
path: root/misc/partinfo.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2005-06-20 08:35:27 -0400
committerTheodore Ts'o <tytso@mit.edu>2005-06-20 08:35:27 -0400
commitbb145b01cf5fd27d9afe03c3262d0e1a326e7ec1 (patch)
tree199daa7232fca52937d08766c2e42a8b0048533f /misc/partinfo.c
parentb7c1d202e454f8357810251e25bfbed518c3ef2e (diff)
downloade2fsprogs-bb145b01cf5fd27d9afe03c3262d0e1a326e7ec1.tar.gz
Fix e2fsprogs messages for grammar and consistency, based on suggestions
from Benno Schulenberg. Add missing _() so all strings can be internationalized.
Diffstat (limited to 'misc/partinfo.c')
-rw-r--r--misc/partinfo.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/misc/partinfo.c b/misc/partinfo.c
index 93631491..f1ec8794 100644
--- a/misc/partinfo.c
+++ b/misc/partinfo.c
@@ -9,6 +9,9 @@
#include <sys/types.h>
#include <fcntl.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
#include <stdio.h>
#include <linux/hdreg.h>
#include <unistd.h>
@@ -16,6 +19,10 @@
#include <errno.h>
#include "nls-enable.h"
+#if defined(__linux__) && defined(_IO) && !defined(BLKGETSIZE)
+#define BLKGETSIZE _IO(0x12,96) /* return device size */
+#endif
+
void print_error(char *operation, int error, char *device)
{
fprintf(stderr, _("%s failed for %s: %s\n"), operation, device,
@@ -35,11 +42,9 @@ int main(int argc, char **argv)
textdomain(NLS_CAT_NAME);
#endif
if (argc == 1) {
- fprintf(stderr, _("Usage: %s <dev1> <dev2> <dev3>\n\n"
- "This program prints out the partition information "
- "for a set of devices\n"
- "A common way to use this program is:\n\n\t"
- "%s /dev/hda?\n\n"), argv[0], argv[0]);
+ fprintf(stderr, _("Usage: %s device...\n\nPrints out the"
+ "partition information for each given device.\n"),
+ "For example: %s /dev/hda\n\n", argv[0], argv[0]);
exit(1);
}
@@ -47,7 +52,7 @@ int main(int argc, char **argv)
fd = open(argv[i], O_RDONLY);
if (fd < 0) {
- print_error("open", errno, argv[i]);
+ print_error(_("open"), errno, argv[i]);
continue;
}