From: Arvin Schnell Date: Fri, 29 Jul 2011 09:53:32 +0000 (+0200) Subject: - check mkstemp failure X-Git-Tag: v0.1.3~340 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=720184d35e10fd25613589a3f317ec636322485e;p=thirdparty%2Fsnapper.git - check mkstemp failure --- diff --git a/snapper/File.cc b/snapper/File.cc index ab5e8f7d..a4bf2c55 100644 --- a/snapper/File.cc +++ b/snapper/File.cc @@ -215,6 +215,11 @@ namespace snapper string tmp_name = output + ".tmp-XXXXXX"; FILE* file = mkstemp(tmp_name); + if (!file) + { + y2err("mkstemp failed errno:" << errno << " (" << strerror(errno) << ")"); + throw IOErrorException(); + } for (const_iterator it = entries.begin(); it != entries.end(); ++it) {