cygcheck: Eenable output of Vista++ FS flags
Also, code cleanup Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
015f6894a0
commit
f16f20ff95
@ -350,7 +350,8 @@ find_on_path (const char *in_file, const char *ext, bool showall = false,
|
|||||||
{
|
{
|
||||||
static char rv[4000];
|
static char rv[4000];
|
||||||
|
|
||||||
/* Sort of a kludge but we've already tested this once, so don't try it again */
|
/* Sort of a kludge but we've already tested this once, so don't try it
|
||||||
|
again */
|
||||||
if (in_file == rv)
|
if (in_file == rv)
|
||||||
return in_file;
|
return in_file;
|
||||||
|
|
||||||
@ -363,13 +364,15 @@ find_on_path (const char *in_file, const char *ext, bool showall = false,
|
|||||||
*rv = '\0';
|
*rv = '\0';
|
||||||
if (!in_file)
|
if (!in_file)
|
||||||
{
|
{
|
||||||
display_error ("internal error find_on_path: NULL pointer for file", false, false);
|
display_error ("internal error find_on_path: NULL pointer for file",
|
||||||
|
false, false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ext)
|
if (!ext)
|
||||||
{
|
{
|
||||||
display_error ("internal error find_on_path: NULL pointer for default_extension", false, false);
|
display_error ("internal error find_on_path: "
|
||||||
|
"NULL pointer for default_extension", false, false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,7 +392,8 @@ find_on_path (const char *in_file, const char *ext, bool showall = false,
|
|||||||
|
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
display_error ("internal error find_on_path: cygpath conversion failed for %s\n", in_file);
|
display_error ("internal error find_on_path: "
|
||||||
|
"cygpath conversion failed for %s\n", in_file);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,7 +407,8 @@ find_on_path (const char *in_file, const char *ext, bool showall = false,
|
|||||||
pth->check_existence (file, showall, verbose, rv, ext);
|
pth->check_existence (file, showall, verbose, rv, ext);
|
||||||
|
|
||||||
if (checklinks)
|
if (checklinks)
|
||||||
pth->check_existence (file, showall, verbose, rv, ext, LINK_EXTENSION);
|
pth->check_existence (file, showall, verbose, rv, ext,
|
||||||
|
LINK_EXTENSION);
|
||||||
|
|
||||||
if (!*ext)
|
if (!*ext)
|
||||||
continue;
|
continue;
|
||||||
@ -1183,7 +1188,8 @@ dump_sysinfo_services ()
|
|||||||
int ret = fscanf (f, "cygrunsrv V%u.%u", &maj, &min);
|
int ret = fscanf (f, "cygrunsrv V%u.%u", &maj, &min);
|
||||||
if (ferror (f) || feof (f) || ret == EOF || maj < 1 || min < 10)
|
if (ferror (f) || feof (f) || ret == EOF || maj < 1 || min < 10)
|
||||||
{
|
{
|
||||||
puts ("The version of cygrunsrv installed is too old to dump service info.\n");
|
puts ("The version of cygrunsrv installed is too old to dump "
|
||||||
|
"service info.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pclose (f);
|
pclose (f);
|
||||||
@ -1191,7 +1197,8 @@ dump_sysinfo_services ()
|
|||||||
/* For verbose mode, just run cygrunsrv --list --verbose and copy output
|
/* For verbose mode, just run cygrunsrv --list --verbose and copy output
|
||||||
verbatim; otherwise run cygrunsrv --list and then cygrunsrv --query for
|
verbatim; otherwise run cygrunsrv --list and then cygrunsrv --query for
|
||||||
each service. */
|
each service. */
|
||||||
snprintf (buf, sizeof (buf), (verbose ? "\"%s\" --list --verbose" : "\"%s\" --list"),
|
snprintf (buf, sizeof (buf),
|
||||||
|
(verbose ? "\"%s\" --list --verbose" : "\"%s\" --list"),
|
||||||
cygrunsrv);
|
cygrunsrv);
|
||||||
if ((f = popen (buf, "rt")) == NULL)
|
if ((f = popen (buf, "rt")) == NULL)
|
||||||
{
|
{
|
||||||
@ -1225,7 +1232,8 @@ dump_sysinfo_services ()
|
|||||||
snprintf (buf2, sizeof (buf2), "\"%s\" --query %s", cygrunsrv, srv);
|
snprintf (buf2, sizeof (buf2), "\"%s\" --query %s", cygrunsrv, srv);
|
||||||
if ((f = popen (buf2, "rt")) == NULL)
|
if ((f = popen (buf2, "rt")) == NULL)
|
||||||
{
|
{
|
||||||
printf ("Failed to execute '%s', skipping services check.\n", buf2);
|
printf ("Failed to execute '%s', skipping services check.\n",
|
||||||
|
buf2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1796,13 +1804,11 @@ dump_sysinfo ()
|
|||||||
flags & FS_PERSISTENT_ACLS ? "PA" : " ",
|
flags & FS_PERSISTENT_ACLS ? "PA" : " ",
|
||||||
flags & FS_FILE_COMPRESSION ? "FC" : " ",
|
flags & FS_FILE_COMPRESSION ? "FC" : " ",
|
||||||
flags & FS_VOL_IS_COMPRESSED ? "VC" : " ",
|
flags & FS_VOL_IS_COMPRESSED ? "VC" : " ",
|
||||||
#if 0
|
|
||||||
flags & FILE_SUPPORTS_ENCRYPTION ? "EN" : " ",
|
flags & FILE_SUPPORTS_ENCRYPTION ? "EN" : " ",
|
||||||
flags & FILE_SUPPORTS_OBJECT_IDS ? "OI" : " ",
|
flags & FILE_SUPPORTS_OBJECT_IDS ? "OI" : " ",
|
||||||
flags & FILE_SUPPORTS_REPARSE_POINTS ? "RP" : " ",
|
flags & FILE_SUPPORTS_REPARSE_POINTS ? "RP" : " ",
|
||||||
flags & FILE_SUPPORTS_SPARSE_FILES ? "SP" : " ",
|
flags & FILE_SUPPORTS_SPARSE_FILES ? "SP" : " ",
|
||||||
flags & FILE_VOLUME_QUOTAS ? "QU" : " ",
|
flags & FILE_VOLUME_QUOTAS ? "QU" : " ",
|
||||||
#endif
|
|
||||||
name);
|
name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2013,6 +2019,13 @@ static const char safe_chars[] = "$-_.+!*'(),";
|
|||||||
static const char base_url[] =
|
static const char base_url[] =
|
||||||
"http://cygwin.com/cgi-bin2/package-grep.cgi?text=1&grep=";
|
"http://cygwin.com/cgi-bin2/package-grep.cgi?text=1&grep=";
|
||||||
|
|
||||||
|
#ifdef __x86_64__
|
||||||
|
#define ARCH_STR "&arch=x86_64"
|
||||||
|
#else
|
||||||
|
#define ARCH_STR "&arch=x86"
|
||||||
|
#endif
|
||||||
|
static const char *ARCH_str = ARCH_STR;
|
||||||
|
|
||||||
/* Queries Cygwin web site for packages containing files matching a regexp.
|
/* Queries Cygwin web site for packages containing files matching a regexp.
|
||||||
Return value is 1 if there was a problem, otherwise 0. */
|
Return value is 1 if there was a problem, otherwise 0. */
|
||||||
static int
|
static int
|
||||||
@ -2021,7 +2034,8 @@ package_grep (char *search)
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
/* construct the actual URL by escaping */
|
/* construct the actual URL by escaping */
|
||||||
char *url = (char *) alloca (sizeof (base_url) + strlen ("&arch=x86_64") + strlen (search) * 3);
|
char *url = (char *) alloca (sizeof (base_url) + strlen (ARCH_str)
|
||||||
|
+ strlen (search) * 3);
|
||||||
strcpy (url, base_url);
|
strcpy (url, base_url);
|
||||||
|
|
||||||
char *dest;
|
char *dest;
|
||||||
@ -2039,11 +2053,7 @@ package_grep (char *search)
|
|||||||
dest += 2;
|
dest += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef __x86_64__
|
strcpy (dest, ARCH_str);
|
||||||
strcpy (dest, "&arch=x86_64");
|
|
||||||
#else
|
|
||||||
strcpy (dest, "&arch=x86");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Connect to the net and open the URL. */
|
/* Connect to the net and open the URL. */
|
||||||
if (InternetAttemptConnect (0) != ERROR_SUCCESS)
|
if (InternetAttemptConnect (0) != ERROR_SUCCESS)
|
||||||
@ -2054,7 +2064,8 @@ package_grep (char *search)
|
|||||||
|
|
||||||
/* Initialize WinInet and attempt to fetch our URL. */
|
/* Initialize WinInet and attempt to fetch our URL. */
|
||||||
HINTERNET hi = NULL, hurl = NULL;
|
HINTERNET hi = NULL, hurl = NULL;
|
||||||
if (!(hi = InternetOpenA ("cygcheck", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0)))
|
if (!(hi = InternetOpenA ("cygcheck", INTERNET_OPEN_TYPE_PRECONFIG,
|
||||||
|
NULL, NULL, 0)))
|
||||||
return display_internet_error ("InternetOpen() failed", NULL);
|
return display_internet_error ("InternetOpen() failed", NULL);
|
||||||
|
|
||||||
if (!(hurl = InternetOpenUrlA (hi, url, NULL, 0, 0, 0)))
|
if (!(hurl = InternetOpenUrlA (hi, url, NULL, 0, 0, 0)))
|
||||||
@ -2159,8 +2170,10 @@ print_version ()
|
|||||||
printf ("cygcheck (cygwin) %d.%d.%d\n"
|
printf ("cygcheck (cygwin) %d.%d.%d\n"
|
||||||
"System Checker for Cygwin\n"
|
"System Checker for Cygwin\n"
|
||||||
"Copyright (C) 1998 - %s Cygwin Authors\n"
|
"Copyright (C) 1998 - %s Cygwin Authors\n"
|
||||||
"This is free software; see the source for copying conditions. There is NO\n"
|
"This is free software; see the source for copying conditions. "
|
||||||
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
|
"There is NO\n"
|
||||||
|
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
|
||||||
|
"PURPOSE.\n",
|
||||||
CYGWIN_VERSION_DLL_MAJOR / 1000,
|
CYGWIN_VERSION_DLL_MAJOR / 1000,
|
||||||
CYGWIN_VERSION_DLL_MAJOR % 1000,
|
CYGWIN_VERSION_DLL_MAJOR % 1000,
|
||||||
CYGWIN_VERSION_DLL_MINOR,
|
CYGWIN_VERSION_DLL_MINOR,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user