Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
913bc430
Commit
913bc430
authored
May 09, 2000
by
Andreas Gustafsson
Browse files
use isc_file_fopen() and isc_file_fclose();
use the logging system, not UNEXPECTED_ERROR()
parent
84fcfe53
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/dns/masterdump.c
View file @
913bc430
...
@@ -779,23 +779,26 @@ isc_result_t
...
@@ -779,23 +779,26 @@ isc_result_t
dns_master_dump
(
isc_mem_t
*
mctx
,
dns_db_t
*
db
,
dns_dbversion_t
*
version
,
dns_master_dump
(
isc_mem_t
*
mctx
,
dns_db_t
*
db
,
dns_dbversion_t
*
version
,
const
dns_master_style_t
*
style
,
const
char
*
filename
)
const
dns_master_style_t
*
style
,
const
char
*
filename
)
{
{
FILE
*
f
;
FILE
*
f
=
NULL
;
isc_result_t
result
;
isc_result_t
result
;
f
=
fopen
(
filename
,
"w"
);
result
=
isc_file_fopen
(
filename
,
"w"
,
&
f
);
if
(
f
==
NULL
)
{
if
(
result
!=
ISC_R_SUCCESS
)
{
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
isc_log_write
(
dns_lctx
,
ISC_LOGCATEOGORY_GENERAL
,
"could not open %s"
,
DNS_LOGMODULE_MASTERDUMP
,
ISC_LOG_ERROR
,
filename
);
"dumping master file: %s: open: %s"
,
filename
,
isc_result_totext
(
result
));
return
(
ISC_R_UNEXPECTED
);
return
(
ISC_R_UNEXPECTED
);
}
}
result
=
dns_master_dumptostream
(
mctx
,
db
,
version
,
style
,
f
);
result
=
dns_master_dumptostream
(
mctx
,
db
,
version
,
style
,
f
);
if
(
fclose
(
f
)
!=
0
)
{
result
=
isc_file_fclose
(
f
);
UNEXPECTED_ERROR
(
__FILE__
,
__LINE__
,
if
(
result
!=
ISC_R_SUCCESS
)
{
"error closing %s"
,
isc_log_write
(
dns_lctx
,
ISC_LOGCATEOGORY_GENERAL
,
filename
);
DNS_LOGMODULE_MASTERDUMP
,
ISC_LOG_ERROR
,
"dumping master file: %s: close: %s"
,
filename
,
isc_result_totext
(
result
));
return
(
ISC_R_UNEXPECTED
);
return
(
ISC_R_UNEXPECTED
);
}
}
...
...
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