static void
write_tables(void) {
- write_super_block();
unsigned long buffsz = get_inode_buffer_size();
unsigned long imaps = get_nimaps();
unsigned long zmaps = get_nzmaps();
+ write_super_block();
+
if (write_all(IN, inode_map, imaps * MINIX_BLOCK_SIZE))
die(_("Unable to write inode map"));
static struct geometry
get_fdisk_geometry_one(struct part_desc *p) {
struct geometry G;
-
- memset(&G, 0, sizeof(struct geometry));
chs b = p->p.end_chs;
longchs bb = chs_to_longchs(b);
+
+ memset(&G, 0, sizeof(struct geometry));
G.heads = bb.h + 1;
G.sectors = bb.s;
G.cylindersize = G.heads * G.sectors;
partitions_ok(int fd, struct disk_desc *z) {
struct part_desc *partitions = &(z->partitions[0]), *p, *q;
int partno = z->partno;
+ int sector_size;
#define PNO(p) pnumber(p, z)
}
}
- int sector_size;
if (blkdev_get_sector_size(fd, §or_size) == -1)
sector_size = DEFAULT_SECTOR_SIZE;
struct part_desc *partitions = &(z->partitions[0]);
int pno = z->partno;
int bsd_later = 1;
+ unsigned short sig, magic;
#ifdef __linux__
bsd_later = (get_linux_version() >= KERNEL_VERSION(2, 3, 40));
#endif
return 0;
}
- unsigned short sig, magic;
memcpy(&sig, s->data + 2, sizeof(sig));
if (sig <= 0x1ae) {
memcpy(&magic, s->data + sig, sizeof(magic));
const char *str_to_print = src;
size_t n_cols = src_size - 1;
size_t n_used_bytes = n_cols; /* Not including NUL */
- size_t n_spaces = 0;
+ size_t n_spaces = 0, space_left;
bool conversion = false;
bool wc_enabled = false;
}
dest = mbs_align_pad (dest, dest_end, start_spaces);
- size_t space_left = dest_end - dest;
+ space_left = dest_end - dest;
dest = mempcpy (dest, str_to_print, min (n_used_bytes, space_left));
mbs_align_pad (dest, dest_end, end_spaces);
}
const char **dirname;
for (dirname = dirlist; *dirname; dirname++) {
- DBG(DEVNAME, blkid_debug("probing UBI volumes under %s",
- *dirname));
-
DIR *dir;
struct dirent *iter;
+ DBG(DEVNAME, blkid_debug("probing UBI volumes under %s",
+ *dirname));
+
dir = opendir(*dirname);
if (dir == NULL)
continue ;
int fdisk_discover_topology(struct fdisk_context *cxt)
{
+#ifdef HAVE_LIBBLKID
+ blkid_probe pr;
+#endif
assert(cxt);
assert(cxt->sector_size == 0);
#ifdef HAVE_LIBBLKID
- blkid_probe pr;
-
DBG(TOPOLOGY, dbgprint("initialize libblkid prober"));
pr = blkid_new_probe();
size_t mbufsize;
unsigned timeout = WRITE_TIME_OUT;
- setlocale(LC_ALL, "");
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
- atexit(close_stdout);
-
static const struct option longopts[] = {
{ "nobanner", no_argument, 0, 'n' },
{ "timeout", required_argument, 0, 't' },
{ NULL, 0, 0, 0 }
};
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+ atexit(close_stdout);
+
while ((ch = getopt_long(argc, argv, "nt:Vh", longopts, NULL)) != -1) {
switch (ch) {
case 'n':
* is the number of half line feeds, otherwise it is the number of whole line
* feeds.
*/
-void flush_blanks()
+void flush_blanks(void)
{
int half, i, nb;
static LINE *line_freelist;
LINE *
-alloc_line()
+alloc_line(void)
{
LINE *l;
int i;
FILE *fp = stdin;
int ch, rval = EXIT_SUCCESS;
+ static const struct option longopts[] = {
+ { "version", no_argument, 0, 'V' },
+ { "help", no_argument, 0, 'h' },
+ { NULL, 0, 0, 0 }
+ };
+
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
signal(SIGINT, sig_handler);
signal(SIGTERM, sig_handler);
- static const struct option longopts[] = {
- { "version", no_argument, 0, 'V' },
- { "help", no_argument, 0, 'h' },
- { NULL, 0, 0, 0 }
- };
-
while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1)
switch(ch) {
case 'V':
struct stat st;
off_t size = 0;
- setlocale(LC_ALL, "");
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
- atexit(close_stdout);
-
static const struct option longopts[] = {
{ "lines", required_argument, 0, 'n' },
{ "version", no_argument, 0, 'V' },
{ NULL, 0, 0, 0 }
};
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+ atexit(close_stdout);
+
lines = old_style_option(&argc, argv);
if (lines < 0)
lines = DEFAULT_LINES;