From 71f90de808505e23c9c28451956742ac362c9ec7 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 12 Nov 2001 00:14:27 +0000 Subject: * cygcheck.cc (scan_registry): Open registry with read-only access. (main): Reflect argument change for dump_setup. * dump_setup.cc (dump_setup): Add preliminary extra argument for future use. * path.cc (read_mounts): Open registry with read-only access. --- winsup/utils/ChangeLog | 8 ++++++++ winsup/utils/cygcheck.cc | 10 +++++----- winsup/utils/dump_setup.cc | 2 +- winsup/utils/path.cc | 2 +- winsup/utils/utils.sgml | 26 +++++++++++++++++--------- 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 79cbc07..44ee1bf 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,5 +1,13 @@ 2001-11-11 Christopher Faylor + * cygcheck.cc (scan_registry): Open registry with read-only access. + (main): Reflect argument change for dump_setup. + * dump_setup.cc (dump_setup): Add preliminary extra argument for future + use. + * path.cc (read_mounts): Open registry with read-only access. + +2001-11-11 Christopher Faylor + * cygcheck.cc (main): Display package info when '-s' is specified. * dump_setup.cc (dump_setup): Change header. Remove typo. Always sort packages output. diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 31d325f..db7132b 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -33,7 +33,7 @@ typedef long long longlong; typedef __int64 longlong; #endif -void dump_setup (int, char **); +void dump_setup (int, char **, bool); const char *known_env_vars[] = { "c_include_path", @@ -739,7 +739,7 @@ scan_registry (RegInfo * prev, HKEY hKey, char *name, int cygnus) ERROR_SUCCESS) { HKEY sKey; - if (RegOpenKeyEx (hKey, subkey_name, 0, KEY_ALL_ACCESS, &sKey) + if (RegOpenKeyEx (hKey, subkey_name, 0, KEY_READ, &sKey) == ERROR_SUCCESS) { scan_registry (&ri, sKey, subkey_name, cygnus); @@ -1270,7 +1270,7 @@ main (int argc, char **argv) if (check_setup) { - dump_setup (verbose, argv); + dump_setup (verbose, argv, true); puts (""); } else @@ -1285,13 +1285,13 @@ main (int argc, char **argv) dump_sysinfo (); if (!check_setup) { - dump_setup (verbose, NULL); + dump_setup (verbose, NULL, false); puts (""); } } if (!givehelp) - printf ("Use -h to see help about each section\n"); + puts ("Use -h to see help about each section"); return 0; } diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc index eacdc50..59150c8 100644 --- a/winsup/utils/dump_setup.cc +++ b/winsup/utils/dump_setup.cc @@ -175,7 +175,7 @@ match_argv (char **argv, const char *name) } void -dump_setup (int verbose, char **argv) +dump_setup (int verbose, char **argv, bool /*check_files*/) { char *setup = cygpath ("/etc/setup/installed.db", NULL); FILE *fp = fopen (setup, "rt"); diff --git a/winsup/utils/path.cc b/winsup/utils/path.cc index d3c99de..b7ddfde 100644 --- a/winsup/utils/path.cc +++ b/winsup/utils/path.cc @@ -119,7 +119,7 @@ read_mounts () CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME); HKEY key = issystem ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; - if (RegCreateKeyEx (key, buf, 0, (LPTSTR) "Cygwin", 0, KEY_ALL_ACCESS, + if (RegCreateKeyEx (key, buf, 0, (LPTSTR) "Cygwin", 0, KEY_READ, 0, &key, &disposition) != ERROR_SUCCESS) break; for (int i = 0; ;i++, m++) diff --git a/winsup/utils/utils.sgml b/winsup/utils/utils.sgml index 1f25c34..9caa44b 100644 --- a/winsup/utils/utils.sgml +++ b/winsup/utils/utils.sgml @@ -9,6 +9,7 @@ specifically for Cygwin. Usage: cygcheck [-s] [-v] [-r] [-h] [program ...] + -c = check current package setup -s = system information -v = verbose output (indented) (for -s or programs) -r = registry search (requires -s) @@ -27,6 +28,11 @@ option, it will give general system information. If you specify -s and list one or more programs on the command line, it reports on both. +The -c option causes the "program" arguments +to be interpreted as package names. cygcheck will +report the current version of the package that you specify. With no +arguments, cygcheck will report on all packages. + The cygcheck program should be used to send information about your system to Cygnus for troubleshooting (if your support representative requests it). When asked to run this command, @@ -120,7 +126,7 @@ done kill -Usage: kill [-sigN] pid1 [pid2 ...] +Usage: kill [-f] [-sigN] pid1 [pid2 ...] The kill program allows you to send arbitrary @@ -130,20 +136,22 @@ also send program-specified signals such as SIGUSR1 to trigger actions within the program, like enabling debugging or re-opening log files. Each program defines the signals they understand. -Note that the "pid" values are the Cygwin pids, not the Windows -pids. To get a list of running programs and their Cygwin pids, use -the Cygwin ps program. +Note that, unless you specific the -f option, +the "pid" values are the Cygwin pids, not the Windows pids. To get a +list of running programs and their Cygwin pids, use the Cygwin +ps program. ps -W will display +all windows pids. -To send a specific signal, use the --signN option, either -with a signal number or a signal name (minus the "SIG" part), like -these examples: +To send a specific signal, use the -signN +option, either with a signal number or a signal name (minus the "SIG" +part), like these examples: -Specifying signals with the kill command +Using the kill command $ kill 123 $ kill -1 123 $ kill -HUP 123 +$ kill -f 123 -- cgit v1.1