gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r14681 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r14681 - gnunet/src/fs
Date: Mon, 21 Mar 2011 11:55:42 +0100

Author: grothoff
Date: 2011-03-21 11:55:42 +0100 (Mon, 21 Mar 2011)
New Revision: 14681

Modified:
   gnunet/src/fs/fs_download.c
Log:
fix

Modified: gnunet/src/fs/fs_download.c
===================================================================
--- gnunet/src/fs/fs_download.c 2011-03-21 10:41:54 UTC (rev 14680)
+++ gnunet/src/fs/fs_download.c 2011-03-21 10:55:42 UTC (rev 14681)
@@ -603,8 +603,9 @@
       pi.value.download.specifics.progress.data_len = dlen;
       pi.value.download.specifics.progress.depth = 0;
       GNUNET_FS_download_make_status_ (&pi, dc);
-      if (0 != truncate (dc->filename,
-                        GNUNET_ntohll (dc->uri->data.chk.file_length)))
+      if ( (NULL != dc->filename) &&
+          (0 != truncate (dc->filename,
+                          GNUNET_ntohll (dc->uri->data.chk.file_length))) )
        GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
                                  "truncate",
                                  dc->filename);
@@ -1975,9 +1976,7 @@
       /* no bytes required! */
       if (dc->filename != NULL) 
        {
-         fh = GNUNET_DISK_file_open (dc->filename != NULL 
-                                     ? dc->filename 
-                                     : dc->temp_filename, 
+         fh = GNUNET_DISK_file_open (dc->filename, 
                                      GNUNET_DISK_OPEN_READWRITE |
                                      GNUNET_DISK_OPEN_CREATE |
                                      ( (0 == GNUNET_FS_uri_chk_get_file_size 
(dc->uri)) 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]