]> wimlib.net Git - wimlib/commitdiff
Win32: Show at most 5 hard linking warnings
authorEric Biggers <ebiggers3@gmail.com>
Thu, 25 Apr 2013 03:26:33 +0000 (22:26 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 25 Apr 2013 03:26:33 +0000 (22:26 -0500)
src/wimlib_internal.h
src/win32.c

index bde430f1662162266112019dcd8e72ed320a812f..5e390efe1364d7b3afb55ecd371a0c1fd9f39170 100644 (file)
@@ -553,18 +553,21 @@ struct apply_args {
                        struct _ntfs_volume *vol;
                };
        #endif
                        struct _ntfs_volume *vol;
                };
        #endif
-               struct {
-                       /* Normal apply only (UNIX) */
-                       unsigned long num_utime_warnings;
-               };
-
+       #ifdef __WIN32__
                struct {
                        /* Normal apply only (Win32) */
                        unsigned long num_set_sacl_priv_notheld;
                        unsigned long num_set_sd_access_denied;
                        unsigned vol_flags;
                struct {
                        /* Normal apply only (Win32) */
                        unsigned long num_set_sacl_priv_notheld;
                        unsigned long num_set_sd_access_denied;
                        unsigned vol_flags;
+                       unsigned long num_hard_links_failed;
                        bool have_vol_flags;
                };
                        bool have_vol_flags;
                };
+       #else
+               struct {
+                       /* Normal apply only (UNIX) */
+                       unsigned long num_utime_warnings;
+               };
+       #endif
        };
 };
 
        };
 };
 
index 4a9e8becec2a762876765834e0d8dc9d4655002e..10f28b3d91280106d4955526f30bc8b10ddf0203 100644 (file)
@@ -46,6 +46,7 @@
 
 #define MAX_GET_SD_ACCESS_DENIED_WARNINGS 1
 #define MAX_GET_SACL_PRIV_NOTHELD_WARNINGS 1
 
 #define MAX_GET_SD_ACCESS_DENIED_WARNINGS 1
 #define MAX_GET_SACL_PRIV_NOTHELD_WARNINGS 1
+#define MAX_CREATE_HARD_LINK_WARNINGS 5
 struct win32_capture_state {
        unsigned long num_get_sd_access_denied;
        unsigned long num_get_sacl_priv_notheld;
 struct win32_capture_state {
        unsigned long num_get_sd_access_denied;
        unsigned long num_get_sacl_priv_notheld;
@@ -1858,10 +1859,15 @@ win32_do_apply_dentry(const wchar_t *output_path,
                        win32_error(err);
                        return WIMLIB_ERR_LINK;
                } else {
                        win32_error(err);
                        return WIMLIB_ERR_LINK;
                } else {
-                       WARNING("Can't create hard link \"%ls => %ls\":\n"
-                               "          Volume does not support hard links!\n"
-                               "          Falling back to extracting a copy of the file.",
-                               output_path, inode->i_extracted_file);
+                       args->num_hard_links_failed++;
+                       if (args->num_hard_links_failed < MAX_CREATE_HARD_LINK_WARNINGS) {
+                               WARNING("Can't create hard link \"%ls => %ls\":\n"
+                                       "          Volume does not support hard links!\n"
+                                       "          Falling back to extracting a copy of the file.",
+                                       output_path, inode->i_extracted_file);
+                       } else if (args->num_hard_links_failed == MAX_CREATE_HARD_LINK_WARNINGS) {
+                               WARNING("Suppressing further hard linking warnings...");
+                       }
                }
        }
 
                }
        }