add an error if we can't write the output file
authorkramm <kramm>
Wed, 12 Nov 2008 10:41:13 +0000 (10:41 +0000)
committerkramm <kramm>
Wed, 12 Nov 2008 10:41:13 +0000 (10:41 +0000)
src/jpeg2swf.c

index 544e7c9..b53958a 100644 (file)
@@ -136,6 +136,9 @@ int MovieFinish(SWF * swf, TAG * t, char *sname)
            sname = "output.swf";
        handle = open(sname, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666);
     }
            sname = "output.swf";
        handle = open(sname, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666);
     }
+    if(handle<0 && sname) {
+        perror(sname);
+    }
     if (swf_WriteSWF(handle, swf)<0) 
         fprintf(stderr, "Unable to write output file: %s\n", sname);
 
     if (swf_WriteSWF(handle, swf)<0) 
         fprintf(stderr, "Unable to write output file: %s\n", sname);