Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
493b7132
Commit
493b7132
authored
Sep 09, 2014
by
Tomek Mrugalski
🛰
Browse files
[3591] Print error to stderr after failing lock file creation.
parent
b48f565f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/log/interprocess/interprocess_sync_file.cc
View file @
493b7132
...
...
@@ -17,6 +17,8 @@
#include <string>
#include <cerrno>
#include <cstring>
#include <sstream>
#include <iostream>
#include <stdlib.h>
#include <string.h>
...
...
@@ -60,9 +62,17 @@ InterprocessSyncFile::do_lock(int cmd, short l_type) {
umask
(
mode
);
if
(
fd_
==
-
1
)
{
isc_throw
(
InterprocessSyncFileError
,
"Unable to use interprocess sync lockfile ("
<<
std
::
strerror
(
errno
)
<<
"): "
<<
lockfile_path
);
std
::
stringstream
tmp
;
// We failed to create a lockfile. This means that the logging
// system is unusable. We need to report the issue using plain
// print to stderr.
tmp
<<
"Unable to use interprocess sync lockfile ("
<<
std
::
strerror
(
errno
)
<<
"): "
<<
lockfile_path
;
std
::
cerr
<<
tmp
.
str
()
<<
std
::
endl
;
// And then throw exception as usual.
isc_throw
(
InterprocessSyncFileError
,
tmp
.
str
());
}
}
...
...
Write
Preview
Supports
Markdown
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