From 9e9bc3a4e4d07db9f6a1c896c02ac10efb0c66b3 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 10 Oct 2011 15:48:54 +0000 Subject: [PATCH] * cygserver.cc (print_usage): Align output to utilities in utils directory. (print_version): Ditto. --- winsup/cygserver/ChangeLog | 6 +++++ winsup/cygserver/cygserver.cc | 49 ++++++++++++++++------------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/winsup/cygserver/ChangeLog b/winsup/cygserver/ChangeLog index 854c8c069..47ad90900 100644 --- a/winsup/cygserver/ChangeLog +++ b/winsup/cygserver/ChangeLog @@ -1,3 +1,9 @@ +2011-10-10 Corinna Vinschen + + * cygserver.cc (print_usage): Align output to utilities in utils + directory. + (print_version): Ditto. + 2011-08-18 Yaakov Selkowitz * sysv_shm.cc (ACCESSPERMS): Remove to fix redefined warning, as diff --git a/winsup/cygserver/cygserver.cc b/winsup/cygserver/cygserver.cc index 262734f95..c58b236fa 100644 --- a/winsup/cygserver/cygserver.cc +++ b/winsup/cygserver/cygserver.cc @@ -1,6 +1,6 @@ /* cygserver.cc - Copyright 2001, 2002, 2003, 2004, 2005, 2007 Red Hat Inc. + Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2011 Red Hat Inc. Written by Egor Duda @@ -449,16 +449,22 @@ static void print_usage (const char *const pgm) { log (LOG_NOTICE, "Usage: %s [OPTIONS]\n" +"\n" +"Cygwin background service daemon\n" +"\n" "Configuration option:\n" +"\n" " -f, --config-file Use as config file. Default is\n" " " DEF_CONFIG_FILE "\n" "\n" "Performance options:\n" +"\n" " -c, --cleanup-threads Number of cleanup threads to use.\n" " -p, --process-cache Size of process cache.\n" " -r, --request-threads Number of request threads to use.\n" "\n" "Logging options:\n" +"\n" " -d, --debug Log debug messages to stderr.\n" " -e, --stderr Log to stderr (default if stderr is a tty).\n" " -E, --no-stderr Don't log to stderr (see -y, -Y options).\n" @@ -467,14 +473,16 @@ print_usage (const char *const pgm) " -Y, --no-syslog Don't log to syslog (See -e, -E options).\n" "\n" "Support options:\n" +"\n" " -m, --no-sharedmem Don't start XSI Shared Memory support.\n" " -q, --no-msgqueues Don't start XSI Message Queue support.\n" " -s, --no-semaphores Don't start XSI Semaphore support.\n" "\n" "Miscellaneous:\n" +"\n" " -S, --shutdown Shutdown the daemon.\n" " -h, --help Output usage information and exit.\n" -" -v, --version Output version information and exit." +" -V, --version Output version information and exit.\n" , pgm); } @@ -485,27 +493,16 @@ print_usage (const char *const pgm) static void print_version () { - char buf[200]; - snprintf (buf, sizeof (buf), "%d.%d.%d(%d.%d/%d/%d)-(%d.%d.%d.%d) %s", - cygwin_version.dll_major / 1000, - cygwin_version.dll_major % 1000, - cygwin_version.dll_minor, - cygwin_version.api_major, - cygwin_version.api_minor, - cygwin_version.shared_data, - CYGWIN_SERVER_VERSION_MAJOR, - CYGWIN_SERVER_VERSION_API, - CYGWIN_SERVER_VERSION_MINOR, - CYGWIN_SERVER_VERSION_PATCH, - cygwin_version.mount_registry, - cygwin_version.dll_build_date); - - log (LOG_INFO, "(cygwin) %s\n" - "API version %s\n" - "Copyright 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.\n" - "Compiled on %s\n" - "Default configuration file is %s", - SERVER_VERSION, buf, __DATE__, DEF_CONFIG_FILE); + log (LOG_INFO, + "cygserver (cygwin) %d.%d.%d\n" + "Cygwin background service daemon\n" + "Copyright (C) 2001 - %s Red Hat, Inc.\n" + "This is free software; see the source for copying conditions. There is NO\n" + "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.", + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } /* @@ -529,13 +526,13 @@ main (const int argc, char *argv[]) {"request-threads", required_argument, NULL, 'r'}, {"no-semaphores", no_argument, NULL, 's'}, {"shutdown", no_argument, NULL, 'S'}, - {"version", no_argument, NULL, 'v'}, + {"version", no_argument, NULL, 'V'}, {"syslog", no_argument, NULL, 'y'}, {"no-syslog", no_argument, NULL, 'Y'}, {0, no_argument, NULL, 0} }; - const char opts[] = "c:deEf:hl:mp:qr:sSvyY"; + const char opts[] = "c:deEf:hl:mp:qr:sSVyY"; long cleanup_threads = 0; long request_threads = 0; @@ -630,7 +627,7 @@ main (const int argc, char *argv[]) shutdown = true; break; - case 'v': + case 'V': print_version (); return 0;