}
refresh_prompt_buffer(sf, devname, next_partno, created);
+
+
if (sf->prompt && (sf->interactive || !sf->quiet)) {
#ifndef HAVE_LIBREADLINE
fputs(sf->prompt, stdout);
continue;
} else if (rc == 1) {
rc = SFDISK_DONE_EOF;
- fputs(_("Done.\n"), stdout);
+ if (!sf->quiet)
+ fputs(_("Done.\n"), stdout);
break;
}
rc = rc == 0 ? SFDISK_DONE_ASK : SFDISK_DONE_ABORT;
break;
} else if (!rc) { /* add partition */
- if (!sf->interactive &&
+ if (!sf->interactive && !sf->quiet &&
(!sf->prompt || startswith(sf->prompt, SFDISK_PROMPT))) {
refresh_prompt_buffer(sf, devname, next_partno, created);
fputs(sf->prompt, stdout);
rc = fdisk_add_partition(sf->cxt, pa, &cur_partno);
if (rc) {
errno = -rc;
- fdisk_warn(sf->cxt, _("Failed to add partition"));
-
+ fdisk_warn(sf->cxt, _("Failed to add #%d partition"), next_partno + 1);
}
}
i = fstat(cxt->dev_fd, &statbuf);
if (i == 0 && S_ISBLK(statbuf.st_mode)) {
+ DBG(CXT, ul_debugobj(cxt, "calling re-read ioctl"));
sync();
#ifdef BLKRRPART
fdisk_info(cxt, _("Calling ioctl() to re-read partition table."));