mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Check return value of the history_save/history_load
The coding style is different and this is the intention, to make look like surrounding code.
This commit is contained in:
parent
f211d33841
commit
f7bf94b5d3
@ -45,7 +45,10 @@ ReplxxLineReader::ReplxxLineReader(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rx.history_load(history_file_path);
|
if (!rx.history_load(history_file_path))
|
||||||
|
{
|
||||||
|
rx.print("Loading history failed: %s\n", strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
if (flock(history_file_fd, LOCK_UN))
|
if (flock(history_file_fd, LOCK_UN))
|
||||||
{
|
{
|
||||||
@ -115,7 +118,8 @@ void ReplxxLineReader::addToHistory(const String & line)
|
|||||||
rx.history_add(line);
|
rx.history_add(line);
|
||||||
|
|
||||||
// flush changes to the disk
|
// flush changes to the disk
|
||||||
rx.history_save(history_file_path);
|
if (!rx.history_save(history_file_path))
|
||||||
|
rx.print("Saving history failed: %s\n", strerror(errno));
|
||||||
|
|
||||||
if (locked && 0 != flock(history_file_fd, LOCK_UN))
|
if (locked && 0 != flock(history_file_fd, LOCK_UN))
|
||||||
rx.print("Unlock of history file failed: %s\n", strerror(errno));
|
rx.print("Unlock of history file failed: %s\n", strerror(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user