Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ada763cf
Commit
ada763cf
authored
Mar 28, 2012
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pg_basebackup: Error handling fixes.
Thomas Ogrisegg and Fujii Masao
parent
81f6bbe8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_basebackup.c
+20
-11
No files found.
src/bin/pg_basebackup/pg_basebackup.c
View file @
ada763cf
...
@@ -584,6 +584,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
...
@@ -584,6 +584,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
{
{
fprintf
(
stderr
,
_
(
"%s: could not write to compressed file
\"
%s
\"
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not write to compressed file
\"
%s
\"
: %s
\n
"
),
progname
,
filename
,
get_gz_error
(
ztarfile
));
progname
,
filename
,
get_gz_error
(
ztarfile
));
disconnect_and_exit
(
1
);
}
}
}
}
else
else
...
@@ -597,21 +598,28 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
...
@@ -597,21 +598,28 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
}
}
}
}
if
(
strcmp
(
basedir
,
"-"
)
==
0
)
{
#ifdef HAVE_LIBZ
#ifdef HAVE_LIBZ
if
(
ztarfile
)
if
(
ztarfile
!=
NULL
)
gzclose
(
ztarfile
);
{
#endif
if
(
gzclose
(
ztarfile
)
!=
0
)
{
fprintf
(
stderr
,
_
(
"%s: could not close compressed file
\"
%s
\"
: %s
\n
"
),
progname
,
filename
,
get_gz_error
(
ztarfile
));
disconnect_and_exit
(
1
);
}
}
}
else
else
{
#ifdef HAVE_LIBZ
if
(
ztarfile
!=
NULL
)
gzclose
(
ztarfile
);
#endif
#endif
if
(
tarfile
!=
NULL
)
{
fclose
(
tarfile
);
if
(
strcmp
(
basedir
,
"-"
)
!=
0
)
{
if
(
fclose
(
tarfile
)
!=
0
)
{
fprintf
(
stderr
,
_
(
"%s: could not close file
\"
%s
\"
: %s
\n
"
),
progname
,
filename
,
strerror
(
errno
));
disconnect_and_exit
(
1
);
}
}
}
}
break
;
break
;
...
@@ -630,6 +638,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
...
@@ -630,6 +638,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
{
{
fprintf
(
stderr
,
_
(
"%s: could not write to compressed file
\"
%s
\"
: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not write to compressed file
\"
%s
\"
: %s
\n
"
),
progname
,
filename
,
get_gz_error
(
ztarfile
));
progname
,
filename
,
get_gz_error
(
ztarfile
));
disconnect_and_exit
(
1
);
}
}
}
}
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment