diff options
author | Nils Durner <durner@gnunet.org> | 2009-11-15 10:03:47 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2009-11-15 10:03:47 +0000 |
commit | 498e92b0ecb6b569ceb7a9e97f727df463a55af5 (patch) | |
tree | 65c01f37353ac726d05b2abed9963493bee6a753 /src | |
parent | e7465b21216e673f116ac01712f5a66e3e306d41 (diff) | |
download | gnunet-498e92b0ecb6b569ceb7a9e97f727df463a55af5.tar.gz gnunet-498e92b0ecb6b569ceb7a9e97f727df463a55af5.zip |
MinGW fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/util/common_logging.c | 2 | ||||
-rw-r--r-- | src/util/disk.c | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 5af499341..b0c97df7d 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -167,7 +167,7 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile) | |||
167 | min_level = get_type (loglevel); | 167 | min_level = get_type (loglevel); |
168 | if (logfile == NULL) | 168 | if (logfile == NULL) |
169 | return GNUNET_OK; | 169 | return GNUNET_OK; |
170 | altlog = fopen (logfile, "a"); | 170 | altlog = FOPEN (logfile, "a"); |
171 | if (altlog == NULL) | 171 | if (altlog == NULL) |
172 | { | 172 | { |
173 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", logfile); | 173 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "fopen", logfile); |
diff --git a/src/util/disk.c b/src/util/disk.c index ce0b2676f..79b1b64a8 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -284,10 +284,15 @@ GNUNET_DISK_mktemp (const char *t) | |||
284 | tmpdir = getenv ("TMPDIR"); | 284 | tmpdir = getenv ("TMPDIR"); |
285 | tmpdir = tmpdir ? tmpdir : "/tmp"; | 285 | tmpdir = tmpdir ? tmpdir : "/tmp"; |
286 | 286 | ||
287 | GNUNET_asprintf (&tmpl, "%s%s%s%s", tmpdir, DIR_SEPARATOR_STR, t, "XXXXXX"); | 287 | GNUNET_asprintf (&tmpl, "%s/%s%s", tmpdir, t, "XXXXXX"); |
288 | #ifdef MINGW | 288 | #ifdef MINGW |
289 | fn = (char *) GNUNET_malloc (MAX_PATH + 1); | 289 | fn = (char *) GNUNET_malloc (MAX_PATH + 1); |
290 | plibc_conv_to_win_path (tmpl, fn); | 290 | if (ERROR_SUCCESS != plibc_conv_to_win_path (tmpl, fn)) |
291 | { | ||
292 | GNUNET_free (fn); | ||
293 | GNUNET_free (tmpl); | ||
294 | return NULL; | ||
295 | } | ||
291 | GNUNET_free (tmpl); | 296 | GNUNET_free (tmpl); |
292 | #else | 297 | #else |
293 | fn = tmpl; | 298 | fn = tmpl; |
@@ -1185,6 +1190,8 @@ GNUNET_DISK_file_open (const char *fn, | |||
1185 | #endif | 1190 | #endif |
1186 | 1191 | ||
1187 | expfn = GNUNET_STRINGS_filename_expand (fn); | 1192 | expfn = GNUNET_STRINGS_filename_expand (fn); |
1193 | if (NULL == expfn) | ||
1194 | return NULL; | ||
1188 | 1195 | ||
1189 | #ifndef MINGW | 1196 | #ifndef MINGW |
1190 | mode = 0; | 1197 | mode = 0; |