X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=misc%2Fpartinfo.c;h=b79d1839d8cb3489cf97fbd5793be7298bbafecd;hb=b5ea01604850e4de8b407a55405f969908a9686b;hp=149a193b27c2706776c7ba58ec5b1df48716cb10;hpb=fe365fd8eff51c474394e9c02c177121ff727510;p=tools%2Fe2fsprogs.git diff --git a/misc/partinfo.c b/misc/partinfo.c index 149a193..b79d183 100644 --- a/misc/partinfo.c +++ b/misc/partinfo.c @@ -4,9 +4,10 @@ * Originally written by Alain Knaff, . * * Cleaned up by Theodore Ts'o, . - * + * */ +#include "config.h" #include #include #ifdef HAVE_SYS_IOCTL_H @@ -17,7 +18,9 @@ #include #include #include -#include "nls-enable.h" +#include +#include "support/nls-enable.h" +#include "et/com_err.h" #if defined(__linux__) && defined(_IO) && !defined(BLKGETSIZE) #define BLKGETSIZE _IO(0x12,96) /* return device size */ @@ -34,6 +37,7 @@ int main(int argc, char **argv) setlocale(LC_CTYPE, ""); bindtextdomain(NLS_CAT_NAME, LOCALEDIR); textdomain(NLS_CAT_NAME); + set_com_err_gettext(gettext); #endif if (argc == 1) { fprintf(stderr, _("Usage: %s device...\n\nPrints out the " @@ -41,7 +45,7 @@ int main(int argc, char **argv) "For example: %s /dev/hda\n\n"), argv[0], argv[0]); exit(1); } - + for (i=1; i < argc; i++) { fd = open(argv[i], O_RDONLY); @@ -50,24 +54,24 @@ int main(int argc, char **argv) argv[i], strerror(errno)); continue; } - + if (ioctl(fd, HDIO_GETGEO, &loc) < 0) { fprintf(stderr, _("Cannot get geometry of %s: %s"), argv[i], strerror(errno)); close(fd); continue; } - - + + if (ioctl(fd, BLKGETSIZE, &size) < 0) { fprintf(stderr, _("Cannot get size of %s: %s"), argv[i], strerror(errno)); close(fd); continue; } - + printf(_("%s: h=%3d s=%3d c=%4d start=%8d size=%8lu end=%8d\n"), - argv[i], + argv[i], loc.heads, (int)loc.sectors, loc.cylinders, (int)loc.start, size, (int) loc.start + size -1); close(fd);