]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - libfdisk/src/sgi.c
libfdisk: remove dependence on libsmartcols
[thirdparty/util-linux.git] / libfdisk / src / sgi.c
index d32b06b940992abad735f867f37f46f22b67d9ad..8e8d3208e1357f47be6c0c7418d4f243917f4a50 100644 (file)
@@ -10,6 +10,7 @@
  *               Arnaldo Carvalho de Melo <acme@conectiva.com.br>, Mar 1999,
  *               Phillip Kesling <pkesling@sgi.com>, Mar 2003.
  */
+
 #include "c.h"
 #include "nls.h"
 #include "all-io.h"
@@ -138,7 +139,7 @@ int fdisk_sgi_create_info(struct fdisk_context *cxt)
        sgilabel->volume[0].num_bytes = cpu_to_be32(sizeof(struct sgi_info));
        strncpy((char *) sgilabel->volume[0].name, "sgilabel", 8);
 
-       fdisk_info(cxt, _("SGI info created on second sector"));
+       fdisk_info(cxt, _("SGI info created on second sector."));
        return 0;
 }
 
@@ -253,7 +254,7 @@ static int sgi_list_table(struct fdisk_context *cxt)
        int rc = 0;
 
        if (fdisk_context_display_details(cxt))
-               fdisk_colon(cxt, _(
+               fdisk_info(cxt, _(
                        "Label geometry: %d heads, %llu sectors\n"
                        "                %llu cylinders, %d physical cylinders\n"
                        "                %d extra sects/cyl, interleave %d:1\n"),
@@ -261,7 +262,7 @@ static int sgi_list_table(struct fdisk_context *cxt)
                        cxt->geom.cylinders, be16_to_cpu(sgiparam->pcylcount),
                        (int) sgiparam->sparecyl, be16_to_cpu(sgiparam->ilfact));
 
-       fdisk_colon(cxt, _("Bootfile: %s"), sgilabel->boot_file);
+       fdisk_info(cxt, _("Bootfile: %s"), sgilabel->boot_file);
        return rc;
 }
 
@@ -906,6 +907,7 @@ static int sgi_create_disklabel(struct fdisk_context *cxt)
 {
        struct fdisk_sgi_label *sgi;
        struct sgi_disklabel *sgilabel;
+       int rc;
 
        assert(cxt);
        assert(cxt->label);
@@ -934,7 +936,10 @@ static int sgi_create_disklabel(struct fdisk_context *cxt)
                }
        }
 #endif
-       fdisk_zeroize_firstsector(cxt);
+       rc = fdisk_init_firstsector_buffer(cxt);
+       if (rc)
+               return rc;
+
        sgi = (struct fdisk_sgi_label *) cxt->label;
        sgi->header = (struct sgi_disklabel *) cxt->firstsector;
 
@@ -1078,14 +1083,14 @@ static int sgi_toggle_partition_flag(struct fdisk_context *cxt, size_t i, unsign
 static const struct fdisk_column sgi_columns[] =
 {
        { FDISK_COL_DEVICE,     N_("Device"),    10,    0 },
-       { FDISK_COL_START,      N_("Start"),      5,    TT_FL_RIGHT },
-       { FDISK_COL_END,        N_("End"),        5,    TT_FL_RIGHT },
-       { FDISK_COL_SECTORS,    N_("Sectors"),    5,    TT_FL_RIGHT },
-       { FDISK_COL_CYLINDERS,  N_("Cylinders"),  5,    TT_FL_RIGHT },
-       { FDISK_COL_SIZE,       N_("Size"),       5,    TT_FL_RIGHT, FDISK_COLFL_EYECANDY },
-       { FDISK_COL_TYPEID,     N_("Id"),         2,    TT_FL_RIGHT },
-       { FDISK_COL_TYPE,       N_("Type"),     0.1,    TT_FL_TRUNC, FDISK_COLFL_EYECANDY },
-       { FDISK_COL_ATTR,       N_("Attrs"),      0,    TT_FL_RIGHT }
+       { FDISK_COL_START,      N_("Start"),      5,    FDISK_COLFL_NUMBER },
+       { FDISK_COL_END,        N_("End"),        5,    FDISK_COLFL_NUMBER },
+       { FDISK_COL_SECTORS,    N_("Sectors"),    5,    FDISK_COLFL_NUMBER },
+       { FDISK_COL_CYLINDERS,  N_("Cylinders"),  5,    FDISK_COLFL_NUMBER },
+       { FDISK_COL_SIZE,       N_("Size"),       5,    FDISK_COLFL_NUMBER | FDISK_COLFL_EYECANDY },
+       { FDISK_COL_TYPEID,     N_("Id"),         2,    FDISK_COLFL_NUMBER },
+       { FDISK_COL_TYPE,       N_("Type"),     0.1,    FDISK_COLFL_EYECANDY },
+       { FDISK_COL_ATTR,       N_("Attrs"),      0,    FDISK_COLFL_NUMBER }
 };
 
 static const struct fdisk_label_operations sgi_operations =