summaryrefslogtreecommitdiff
path: root/lib/file.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-04-17 00:45:33 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-04-17 00:45:33 +0000
commit09777a4fc2ed0f2b09447eb89fb8cd4b99278944 (patch)
tree6bacd3d36ad24891153d55d573d776ca25065ce9 /lib/file.c
parent03310713467b678812067b3edab82b23ed6b1c04 (diff)
downloadcurl-09777a4fc2ed0f2b09447eb89fb8cd4b99278944.tar.gz
Some trivial changes
Diffstat (limited to 'lib/file.c')
-rw-r--r--lib/file.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/file.c b/lib/file.c
index 1e8374693..c79c635ec 100644
--- a/lib/file.c
+++ b/lib/file.c
@@ -68,7 +68,7 @@
#include <fcntl.h>
#endif
-#endif
+#endif /* WIN32 */
#include "strtoofft.h"
#include "urldata.h"
@@ -90,6 +90,9 @@
/* The last #include file should be: */
#include "memdebug.h"
+#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
+#define MSDOS_FILESYSTEM 1
+#endif
/*
* Forward declarations.
@@ -186,7 +189,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
char *real_path = curl_easy_unescape(data, data->state.path, 0, NULL);
struct FILEPROTO *file;
int fd;
-#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
+#ifdef MSDOS_FILESYSTEM
int i;
char *actual_path;
#endif
@@ -217,7 +220,7 @@ static CURLcode file_connect(struct connectdata *conn, bool *done)
file->fd = -1;
}
-#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
+#ifdef MSDOS_FILESYSTEM
/* If the first character is a slash, and there's
something that looks like a drive at the beginning of
the path, skip the slash. If we remove the initial
@@ -279,7 +282,7 @@ static CURLcode file_done(struct connectdata *conn,
return CURLE_OK;
}
-#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
+#ifdef MSDOS_FILESYSTEM
#define DIRSEP '\\'
#else
#define DIRSEP '/'
@@ -319,13 +322,13 @@ static CURLcode file_upload(struct connectdata *conn)
else {
int fd;
-#if defined(WIN32) || defined(MSDOS) || defined(__EMX__)
+#ifdef MSDOS_FILESYSTEM
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY,
conn->data->set.new_file_perms);
-#else /* !(WIN32 || MSDOS || __EMX__) */
+#else
fd = open(file->path, O_WRONLY|O_CREAT|O_TRUNC,
conn->data->set.new_file_perms);
-#endif /* !(WIN32 || MSDOS || __EMX__) */
+#endif
if(fd < 0) {
failf(data, "Can't open %s for writing", file->path);
return CURLE_WRITE_ERROR;