]> granicus.if.org Git - curl/commitdiff
Jamie Newton pointed out that libcurl's file:// code would close() a zero
authorDaniel Stenberg <daniel@haxx.se>
Thu, 1 Dec 2005 23:42:03 +0000 (23:42 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 1 Dec 2005 23:42:03 +0000 (23:42 +0000)
file descriptor if given a non-existing file.

CHANGES
RELEASE-NOTES
lib/file.c

diff --git a/CHANGES b/CHANGES
index d162878a886adb64ac577c0ed3bb5bf1277ac022..b1cad112bf1a750176c20c404235e86674f22722 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,10 @@
 
 
 
+Daniel (2 December 2005)
+- Jamie Newton pointed out that libcurl's file:// code would close() a zero
+  file descriptor if given a non-existing file.
+
 Daniel (24 November 2005)
 - Doug Kaufman provided a set of patches to make curl build fine on DJGPP
   again using configure.
index 148fac0b23b22caf8f8e0cfba02a58f5c92515d8..f84c2c37702a6d78b969542f52a11090c7eda66b 100644 (file)
@@ -19,6 +19,7 @@ This release includes the following changes:
 
 This release includes the following bugfixes:
 
+ o using file:// on non-existing files are properly handled
  o builds fine on DJGPP
  o CURLOPT_ERRORBUFFER is now always filled in on errors
  o curl outputs error on bad --limit-rate units
@@ -51,8 +52,8 @@ This release would not have looked like this without help, code, reports and
 advice from friends like these:
 
  Dave Dribin, Bradford Bruce, Temprimus, Ofer, Dima Barsky, Amol Pattekar, Jaz
- Fresh, tommink[at]post.pl, Gisle Vanem, Nis Jorgensen, Vilmos Nebehaj,
Dmitry Bartsevich, David Lang, Eugene Kotlyarov, Jan Kunder, Yang Tse,
Quagmire, Albert Chin, David Shaw, Doug Kaufman, Bryan Henderson
+ Fresh, tommink[at]post.pl, Gisle Vanem, Nis Jorgensen, Vilmos Nebehaj, Dmitry
Bartsevich, David Lang, Eugene Kotlyarov, Jan Kunder, Yang Tse, Quagmire,
Albert Chin, David Shaw, Doug Kaufman, Bryan Henderson, Jamie Newton
 
         Thanks! (and sorry if I forgot to mention someone)
index c325a467372d1915f8ccbd0ce07f5bebd6e71636..dbfe81cfa50a48effddf45e780a902754d8181d2 100644 (file)
@@ -158,12 +158,12 @@ CURLcode Curl_file_connect(struct connectdata *conn)
 #endif
   file->freepath = real_path; /* free this when done */
 
+  file->fd = fd;
   if(!conn->data->set.upload && (fd == -1)) {
     failf(conn->data, "Couldn't open file %s", conn->path);
     Curl_file_done(conn, CURLE_FILE_COULDNT_READ_FILE);
     return CURLE_FILE_COULDNT_READ_FILE;
   }
-  file->fd = fd;
 
   return CURLE_OK;
 }