From: Eric Biggers Date: Thu, 25 Apr 2013 03:26:33 +0000 (-0500) Subject: Win32: Show at most 5 hard linking warnings X-Git-Tag: v1.3.3~40 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=5c0d30fbd73ee5e9f080d0763ec08eb68fe69314 Win32: Show at most 5 hard linking warnings --- diff --git a/src/wimlib_internal.h b/src/wimlib_internal.h index bde430f1..5e390efe 100644 --- a/src/wimlib_internal.h +++ b/src/wimlib_internal.h @@ -553,18 +553,21 @@ struct apply_args { 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; + unsigned long num_hard_links_failed; bool have_vol_flags; }; + #else + struct { + /* Normal apply only (UNIX) */ + unsigned long num_utime_warnings; + }; + #endif }; }; diff --git a/src/win32.c b/src/win32.c index 4a9e8bec..10f28b3d 100644 --- a/src/win32.c +++ b/src/win32.c @@ -46,6 +46,7 @@ #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; @@ -1858,10 +1859,15 @@ win32_do_apply_dentry(const wchar_t *output_path, 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..."); + } } }