Check return value of symlink().
[dcpomatic.git] / src / lib / j2k_still_encoder.cc
index 5243f066860bcab2d2fa7319b6ce5bdf12f112a9..3109e244ce5e7fc29c44a773381d8e144d9701a6 100644 (file)
@@ -67,7 +67,10 @@ J2KStillEncoder::process_video (shared_ptr<Image> yuv, int frame)
                if (!boost::filesystem::exists (_opt->frame_out_path (i, false))) {
                        string const link = _opt->frame_out_path (i, false);
 #ifdef DVDOMATIC_POSIX                 
-                       symlink (real.c_str(), link.c_str());
+                       int const r = symlink (real.c_str(), link.c_str());
+                       if (r) {
+                               throw EncodeError ("could not create symlink");
+                       }
 #endif
 #ifdef DVDOMATIC_WINDOWS
                        filesystem::copy_file (real, link);