Skip to content
Snippets Groups Projects
Commit 020defef authored by Morris Jette's avatar Morris Jette
Browse files

Log write error

Coverity CID 44761
parent 21ea996c
No related branches found
No related tags found
No related merge requests found
...@@ -1944,8 +1944,13 @@ static void _queue_teardown(uint32_t job_id, uint32_t user_id, bool hurry) ...@@ -1944,8 +1944,13 @@ static void _queue_teardown(uint32_t job_id, uint32_t user_id, bool hurry)
if (stat(job_script, &buf) == -1) { if (stat(job_script, &buf) == -1) {
fd = creat(job_script, 0755); fd = creat(job_script, 0755);
if (fd >= 0) { if (fd >= 0) {
int len;
char *dummy_script = "#!/bin/bash\nexit 0\n"; char *dummy_script = "#!/bin/bash\nexit 0\n";
write(fd, dummy_script, strlen(dummy_script)+1); len = strlen(dummy_script) + 1;
if (write(fd, dummy_script, len) != len) {
verbose("%s: write(%s): %m",
__func__, job_script);
}
close(fd); close(fd);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment