gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r869 - in GNUnet/src: applications/fs/ecrs util


From: durner
Subject: [GNUnet-SVN] r869 - in GNUnet/src: applications/fs/ecrs util
Date: Sun, 5 Jun 2005 09:04:16 -0700 (PDT)

Author: durner
Date: 2005-06-05 09:04:10 -0700 (Sun, 05 Jun 2005)
New Revision: 869

Modified:
   GNUnet/src/applications/fs/ecrs/upload.c
   GNUnet/src/util/hashing.c
   GNUnet/src/util/io.c
Log:
- always open files in binary mode under Windows
- more errors messages

Modified: GNUnet/src/applications/fs/ecrs/upload.c
===================================================================
--- GNUnet/src/applications/fs/ecrs/upload.c    2005-06-05 10:41:23 UTC (rev 
868)
+++ GNUnet/src/applications/fs/ecrs/upload.c    2005-06-05 16:04:10 UTC (rev 
869)
@@ -176,6 +176,7 @@
   if (doIndex) {
     if (SYSERR == getFileHash(filename,
                              &fileId)) {
+                       LOG(LOG_ERROR, _("Cannot hash '%s'.\n"), filename);
       releaseClientSocket(sock);
       return SYSERR;
     }
@@ -201,8 +202,10 @@
     return SYSERR;
   }
 
-  if (FS_initIndex(sock, &fileId, filename) == SYSERR)
+  if (FS_initIndex(sock, &fileId, filename) == SYSERR) {
+       LOG(LOG_ERROR, "'%s' failed.\n", _("Initialization"));
     return SYSERR;
+  }
 
   dblock = MALLOC(sizeof(Datastore_Value) + DBLOCK_SIZE + sizeof(DBlock));
   dblock->size = htonl(sizeof(Datastore_Value) + DBLOCK_SIZE + sizeof(DBlock));
@@ -267,8 +270,10 @@
       if (SYSERR == FS_index(sock,
                             &fileId,
                             dblock,
-                            pos))
-       goto FAILURE;
+                            pos)) {
+                               LOG(LOG_ERROR, _("Indexing data failed at 
position %i.\n"), pos);
+                               goto FAILURE;
+                       }
     } else {
       value = NULL;
       if (OK !=

Modified: GNUnet/src/util/hashing.c
===================================================================
--- GNUnet/src/util/hashing.c   2005-06-05 10:41:23 UTC (rev 868)
+++ GNUnet/src/util/hashing.c   2005-06-05 16:04:10 UTC (rev 869)
@@ -335,8 +335,10 @@
            O_RDONLY
 #endif
            );
-  if (fh == -1)
+  if (fh == -1) {
+               LOG(LOG_ERROR, "Cannot open file\n");
     return SYSERR;
+  }
   sha512_init(&ctx);
   pos = 0;
   buf = MALLOC(65536);
@@ -348,6 +350,7 @@
     if (delta != READ(fh,
                      buf,
                      delta)) {
+                 LOG(LOG_ERROR, "Error reading from file at position %i\n", 
pos);
       closefile(fh);
       FREE(buf);
       return SYSERR;

Modified: GNUnet/src/util/io.c
===================================================================
--- GNUnet/src/util/io.c        2005-06-05 10:41:23 UTC (rev 868)
+++ GNUnet/src/util/io.c        2005-06-05 16:04:10 UTC (rev 869)
@@ -350,9 +350,10 @@
 
 #ifdef MINGW
   /* Set binary mode */
-  mode |= O_BINARY;
+  oflag |= O_BINARY;
 #endif
 
+LOG(LOG_DEBUG, "DBG: open(%s, %i, %i)\n", fn, oflag, mode);
   return open(fn, oflag, mode);
 }
 





reply via email to

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