Dmitry Gorbachev
authorColin Finck <colin@reactos.org>
Wed, 19 Nov 2008 19:59:54 +0000 (19:59 +0000)
committerColin Finck <colin@reactos.org>
Wed, 19 Nov 2008 19:59:54 +0000 (19:59 +0000)
- Fix compiler warnings, treated as errors due to our settings, which are emitted when using GCC 4.3.2

See issue #3849 for more details.

svn path=/trunk/; revision=37465

reactos/tools/cabman/cabinet.cxx
reactos/tools/cdmake/cdmake.c
reactos/tools/rgenstat/rgenstat.c

index c09eea9..355d663 100755 (executable)
@@ -2055,9 +2055,19 @@ ULONG CCabinet::AddFile(char* FileName)
         return CAB_STATUS_CANNOT_READ;
     }
 
-    GetFileTimes(SrcFile, FileNode);
+    if (GetFileTimes(SrcFile, FileNode) != CAB_STATUS_SUCCESS)
+    {
+        DPRINT(MIN_TRACE, ("Cannot read file times.\n"));
+        FreeMemory(NewFileName);
+        return CAB_STATUS_CANNOT_READ;
+    }
 
-    GetAttributesOnFile(FileNode);
+    if (GetAttributesOnFile(FileNode) != CAB_STATUS_SUCCESS)
+    {
+        DPRINT(MIN_TRACE, ("Cannot read file attributes.\n"));
+        FreeMemory(NewFileName);
+        return CAB_STATUS_CANNOT_READ;
+    }
 
     CloseFile(SrcFile);
 
@@ -3646,7 +3656,8 @@ ULONG CCabinet::GetFileTimes(FILEHANDLE FileHandle, PCFFILE_NODE File)
         strcpy(buf, File->FileName);
     else
     {
-        getcwd(buf, sizeof(buf));
+        if (!getcwd(buf, sizeof(buf)))
+            return CAB_STATUS_CANNOT_READ;
         strcat(buf, DIR_SEPARATOR_STRING);
         strcat(buf, File->FileName);
     }
@@ -3689,7 +3700,8 @@ ULONG CCabinet::GetAttributesOnFile(PCFFILE_NODE File)
         strcpy(buf, File->FileName);
     else
     {
-        getcwd(buf, sizeof(buf));
+        if (!getcwd(buf, sizeof(buf)))
+            return CAB_STATUS_CANNOT_READ;
         strcat(buf, DIR_SEPARATOR_STRING);
         strcat(buf, File->FileName);
     }
index b36c25a..169cb3e 100644 (file)
@@ -882,7 +882,8 @@ make_directory_records (PDIR_RECORD d)
                 }
               else
                 {
-                  getcwd(buf, sizeof(buf));
+                  if (!getcwd(buf, sizeof(buf)))
+                    error_exit("Can't get CWD: %s\n", strerror(errno));
                   strcat(buf, DIR_SEPARATOR_STRING);
                   strcat(buf, source);
                   strcat(buf, entry->d_name);
@@ -943,7 +944,8 @@ make_directory_records (PDIR_RECORD d)
                     }
                   else
                     {
-                      getcwd(buf, sizeof(buf));
+                      if (!getcwd(buf, sizeof(buf)))
+                        error_exit("Can't get CWD: %s\n", strerror(errno));
                       strcat(buf, DIR_SEPARATOR_STRING);
                       strcat(buf, source);
                     }
@@ -994,7 +996,8 @@ make_directory_records (PDIR_RECORD d)
             }
           else
             {
-              getcwd(buf, sizeof(buf));
+              if (!getcwd(buf, sizeof(buf)))
+                error_exit("Can't get CWD: %s\n", strerror(errno));
               strcat(buf, DIR_SEPARATOR_STRING);
               strcat(buf, source);
               strcat(buf, entry->d_name);
index 336a0b7..7b2393f 100755 (executable)
@@ -553,7 +553,11 @@ process_directory (char *path, char *cvspath)
                 }
               else
                 {
-                  getcwd(buf, sizeof(buf));
+                  if (!getcwd(buf, sizeof(buf)))
+                    {
+                      printf("Can't get CWD: %s\n", strerror(errno));
+                      return;
+                    }
                   strcat(buf, DIR_SEPARATOR_STRING);
                   strcat(buf, path);
                   strcat(buf, entry->d_name);
@@ -611,7 +615,11 @@ process_directory (char *path, char *cvspath)
             }
           else
             {
-              getcwd(buf, sizeof(buf));
+              if (!getcwd(buf, sizeof(buf)))
+                {
+                  printf("Can't get CWD: %s\n", strerror(errno));
+                  return;
+                }
               strcat(buf, DIR_SEPARATOR_STRING);
               strcat(buf, path);
               strcat(buf, entry->d_name);