git://project.juiblex.co.uk
/
razor2.git/.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
7b7f767
)
Detect failure to create download target file.
author
Kristian Høgsberg
<krh@jiraiya.boston.redhat.com>
Tue, 8 Apr 2008 01:32:19 +0000 (21:32 -0400)
committer
Kristian Høgsberg
<krh@jiraiya.boston.redhat.com>
Tue, 8 Apr 2008 01:32:19 +0000 (21:32 -0400)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index
cb817b1
..
a72d419
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-267,6
+267,11
@@
download_if_missing(const char *url, const char *file)
if (stat(file, &buf) < 0) {
fp = fopen(file, "w");
+ if (fp == NULL) {
+ fprintf(stderr,
+ "failed to open %s for writing\n", file);
+ return -1;
+ }
curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
curl_easy_setopt(curl, CURLOPT_URL, url);
res = curl_easy_perform(curl);