]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- check mkstemp failure
authorArvin Schnell <aschnell@suse.de>
Fri, 29 Jul 2011 09:53:32 +0000 (11:53 +0200)
committerArvin Schnell <aschnell@suse.de>
Fri, 29 Jul 2011 09:53:32 +0000 (11:53 +0200)
snapper/File.cc

index ab5e8f7d2521531622b187233e368a5c6a6db3b1..a4bf2c55561eccdd1cd3cbf1a581f87ec9f22174 100644 (file)
@@ -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)
        {