Commit cd626cd2 authored by Julian Rother's avatar Julian Rother

publish_video: Check if directory exists before using mkdir

parent ee0f24a0
......@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
ping_job(jobid, "running", 0);
src = buildpath(getenv(WORKER_TMP), jstr(jlookup(argv[4], "source"), 0));
destdir = buildpath(getenv(WORKER_RELEASED), dirname(jstr(jlookup(argv[4], "path"), 0)));
if (mkdir(destdir, 02775) && errno != EEXIST)
if (access(destdir, F_OK) && mkdir(destdir, 02775))
job_failed("Could not create target directory \"%s\": %s", destdir, strerror(errno));
dest = buildpath(getenv(WORKER_RELEASED), jstr(jlookup(argv[4], "path"), 0));
overwrite_check(dest, 0, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment