Skip to content
Snippets Groups Projects
Commit cd626cd2 authored by Julian Rother's avatar Julian Rother
Browse files

publish_video: Check if directory exists before using mkdir

parent ee0f24a0
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment