fdisk: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
3862f68538
commit
b2d28533dd
|
@ -97,6 +97,7 @@
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "closestream.h"
|
||||||
#include "nls.h"
|
#include "nls.h"
|
||||||
#include "rpmatch.h"
|
#include "rpmatch.h"
|
||||||
#include "blkdev.h"
|
#include "blkdev.h"
|
||||||
|
@ -2767,6 +2768,7 @@ main(int argc, char **argv)
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
atexit(close_stdout);
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "ac:gh:s:vzP:")) != -1)
|
while ((c = getopt(argc, argv, "ac:gh:s:vzP:")) != -1)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
#include "canonicalize.h"
|
#include "canonicalize.h"
|
||||||
#include "strutils.h"
|
#include "strutils.h"
|
||||||
|
#include "closestream.h"
|
||||||
|
|
||||||
#include "fdisksunlabel.h"
|
#include "fdisksunlabel.h"
|
||||||
#include "fdisksgilabel.h"
|
#include "fdisksgilabel.h"
|
||||||
|
@ -2958,6 +2959,7 @@ main(int argc, char **argv) {
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
atexit(close_stdout);
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "b:c::C:hH:lsS:u::vV")) != -1) {
|
while ((c = getopt(argc, argv, "b:c::C:hH:lsS:u::vV")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "gpt.h"
|
#include "gpt.h"
|
||||||
#include "blkdev.h"
|
#include "blkdev.h"
|
||||||
#include "bitops.h"
|
#include "bitops.h"
|
||||||
|
#include "closestream.h"
|
||||||
|
|
||||||
#define GPT_HEADER_SIGNATURE 0x5452415020494645LL
|
#define GPT_HEADER_SIGNATURE 0x5452415020494645LL
|
||||||
#define GPT_PRIMARY_PARTITION_TABLE_LBA 1
|
#define GPT_PRIMARY_PARTITION_TABLE_LBA 1
|
||||||
|
@ -202,6 +203,7 @@ gpt_probe_signature_devname(char *devname)
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
atexit(close_stdout);
|
||||||
if (argc!=2)
|
if (argc!=2)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "usage: %s <dev>\n", argv[0]);
|
fprintf(stderr, "usage: %s <dev>\n", argv[0]);
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "closestream.h"
|
||||||
|
|
||||||
struct aix_label {
|
struct aix_label {
|
||||||
unsigned int magic;
|
unsigned int magic;
|
||||||
/* more ... */
|
/* more ... */
|
||||||
|
@ -53,6 +55,7 @@ main(int argc, char **argv) {
|
||||||
struct sgi_label *psgi;
|
struct sgi_label *psgi;
|
||||||
struct sun_label *psun;
|
struct sun_label *psun;
|
||||||
|
|
||||||
|
atexit(close_stdout);
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
fprintf(stderr, "call: %s device\n", argv[0]);
|
fprintf(stderr, "call: %s device\n", argv[0]);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
#include "canonicalize.h"
|
#include "canonicalize.h"
|
||||||
#include "rpmatch.h"
|
#include "rpmatch.h"
|
||||||
|
#include "closestream.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Table of contents:
|
* Table of contents:
|
||||||
|
@ -2572,6 +2573,7 @@ main(int argc, char **argv) {
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
bindtextdomain(PACKAGE, LOCALEDIR);
|
||||||
textdomain(PACKAGE);
|
textdomain(PACKAGE);
|
||||||
|
atexit(close_stdout);
|
||||||
|
|
||||||
if (argc < 1)
|
if (argc < 1)
|
||||||
errx(EXIT_FAILURE, _("no command?"));
|
errx(EXIT_FAILURE, _("no command?"));
|
||||||
|
|
Loading…
Reference in New Issue