Merge lp:~jpakkane/libcolumbus/check-temp-file into lp:libcolumbus

Proposed by Jussi Pakkanen
Status: Merged
Approved by: Jussi Pakkanen
Approved revision: 456
Merged at revision: 456
Proposed branch: lp:~jpakkane/libcolumbus/check-temp-file
Merge into: lp:libcolumbus
Diff against target: 15 lines (+5/-0)
1 file modified
src/Trie.cc (+5/-0)
To merge this branch: bzr merge lp:~jpakkane/libcolumbus/check-temp-file
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Unity Team Pending
Review via email: mp+191162@code.launchpad.net

Commit message

Fail early if temporary file can't be created.

Description of the change

Fail early if temporary file can't be created.

To post a comment you must log in.
456. By Jussi Pakkanen

Fail early if temporary file can't be created.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Trie.cc'
2--- src/Trie.cc 2013-01-31 10:23:45 +0000
3+++ src/Trie.cc 2013-10-15 12:04:28 +0000
4@@ -74,6 +74,11 @@
5 Trie::Trie() {
6 p = new TriePrivate();
7 p->f = tmpfile();
8+ if(!p->f) {
9+ string msg("Could not create temporary file: ");
10+ msg += strerror(errno);
11+ throw runtime_error(msg);
12+ }
13 p->map = nullptr;
14 expand();
15 p->h->firstFree = sizeof(TrieHeader);

Subscribers

People subscribed via source and target branches

to all changes: