From 1b23b30b29eebbe7c9953f2a7470f31a0feb8702 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 17 Dec 2011 23:39:47 +0000 Subject: Clean up whitespace. --- winsup/utils/bloda.cc | 220 ++++++++++----------- winsup/utils/cygcheck.cc | 72 +++---- winsup/utils/cygpath.cc | 2 +- winsup/utils/dump_setup.cc | 46 ++--- winsup/utils/dumper.cc | 14 +- winsup/utils/getconf.c | 120 ++++++------ winsup/utils/getfacl.c | 96 +++++----- winsup/utils/kill.cc | 28 +-- winsup/utils/ldd.cc | 20 +- winsup/utils/loadlib.h | 2 +- winsup/utils/locale.cc | 30 +-- winsup/utils/mkgroup.c | 14 +- winsup/utils/mkpasswd.c | 14 +- winsup/utils/mount.cc | 20 +- winsup/utils/passwd.c | 128 ++++++------- winsup/utils/path.cc | 88 ++++----- winsup/utils/ps.cc | 18 +- winsup/utils/regtool.cc | 28 +-- winsup/utils/setfacl.c | 468 ++++++++++++++++++++++----------------------- winsup/utils/setmetamode.c | 16 +- winsup/utils/ssp.c | 74 +++---- winsup/utils/strace.cc | 44 ++--- winsup/utils/testsuite.cc | 30 +-- winsup/utils/testsuite.h | 10 +- winsup/utils/umount.cc | 14 +- winsup/utils/wide_path.h | 2 +- 26 files changed, 809 insertions(+), 809 deletions(-) (limited to 'winsup/utils') diff --git a/winsup/utils/bloda.cc b/winsup/utils/bloda.cc index c6443184f..2cd799aea 100644 --- a/winsup/utils/bloda.cc +++ b/winsup/utils/bloda.cc @@ -39,12 +39,12 @@ Kerio, Agnitum or ZoneAlarm Personal Firewall Iolo System Mechanic/AntiVirus/Firewall LanDesk - Windows Defender + Windows Defender Embassy Trust Suite fingerprint reader software containing wxvault.dll - ByteMobile laptop optimization client - - A live version is now being maintained in the Cygwin FAQ, at - http://cygwin.com/faq/faq.using.html#faq.using.bloda + ByteMobile laptop optimization client + + A live version is now being maintained in the Cygwin FAQ, at + http://cygwin.com/faq/faq.using.html#faq.using.bloda */ @@ -85,7 +85,7 @@ static const struct bad_app_det dodgy_app_detects[] = { PROCESSNAME, "LVPrcSrv.exe", LOGITECH }, { FILENAME, "%programfiles%\\common files\\logitech\\lvmvfm\\LVPrcSrv.exe", LOGITECH }, { FILENAME, "%windir%\\System32\\bmnet.dll", BYTEMOBILE }, -}; +}; static const size_t num_of_detects = sizeof (dodgy_app_detects) / sizeof (dodgy_app_detects[0]); @@ -146,13 +146,13 @@ find_process_in_list (PSYSTEM_PROCESSES pslist, PUNICODE_STRING psname) while (1) { if (pslist->ProcessName.Length && pslist->ProcessName.Buffer) - { - dbg_printf (("%S\n", pslist->ProcessName.Buffer)); - if (!_wcsicmp (pslist->ProcessName.Buffer, psname->Buffer)) - return true; - } + { + dbg_printf (("%S\n", pslist->ProcessName.Buffer)); + if (!_wcsicmp (pslist->ProcessName.Buffer, psname->Buffer)) + return true; + } if (!pslist->NextEntryDelta) - break; + break; pslist = (PSYSTEM_PROCESSES)(pslist->NextEntryDelta + (char *)pslist); }; return false; @@ -168,7 +168,7 @@ find_module_in_list (PSYSTEM_MODULE_INFORMATION modlist, const char * const modn dbg_printf (("name '%s' offset %d ", &modptr->ImageName[0], modptr->PathLength)); dbg_printf (("= '%s'\n", &modptr->ImageName[modptr->PathLength])); if (!_stricmp (&modptr->ImageName[modptr->PathLength], modname)) - return true; + return true; modptr++; } return false; @@ -185,45 +185,45 @@ expand_path (const char *path, char *outbuf) while ((dst - outbuf) < MAX_PATH) { if (*path != '%') - { - if ((*dst++ = *path++) != 0) - continue; - break; - } + { + if ((*dst++ = *path++) != 0) + continue; + break; + } /* Expand an environ var. */ end = path + 1; while (*end != '%') - { - /* Watch out for unterminated % */ - if (*end++ == 0) - { - end = NULL; - break; - } - } + { + /* Watch out for unterminated % */ + if (*end++ == 0) + { + end = NULL; + break; + } + } /* If we didn't find the end, can't expand it. */ if ((end == NULL) || (end == (path + 1))) - { - /* Unterminated % so copy verbatim. */ - *dst++ = *path++; - continue; - } + { + /* Unterminated % so copy verbatim. */ + *dst++ = *path++; + continue; + } /* Expand the environment var into the new path. */ if ((end - (path + 1)) >= MAX_PATH) - return -1; + return -1; memcpy (envvar, path + 1, end - (path + 1)); envvar[end - (path + 1)] = 0; envval = getenv (envvar); /* If not found, copy env var name verbatim. */ if (envval == NULL) - { - *dst++ = *path++; - continue; - } + { + *dst++ = *path++; + continue; + } /* Check enough room before copying. */ len = strlen (envval); if ((dst + len - outbuf) >= MAX_PATH) - return false; + return false; memcpy (dst, envval, len); dst += len; /* And carry on past the end of env var name. */ @@ -232,7 +232,7 @@ expand_path (const char *path, char *outbuf) return (dst - outbuf) < MAX_PATH; } -static bool +static bool detect_dodgy_app (const struct bad_app_det *det, PSYSTEM_PROCESSES pslist, PSYSTEM_MODULE_INFORMATION modlist) { HANDLE fh; @@ -248,39 +248,39 @@ detect_dodgy_app (const struct bad_app_det *det, PSYSTEM_PROCESSES pslist, PSYST case HKLMKEY: dbg_printf (("Detect reg key hklm '%s'... ", det->param)); if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, det->param, 0, STANDARD_RIGHTS_READ, &hk) == ERROR_SUCCESS) - { - RegCloseKey (hk); - dbg_printf (("found!\n")); - return true; - } + { + RegCloseKey (hk); + dbg_printf (("found!\n")); + return true; + } break; case HKCUKEY: dbg_printf (("Detect reg key hkcu '%s'... ", det->param)); if (RegOpenKeyEx (HKEY_CURRENT_USER, det->param, 0, STANDARD_RIGHTS_READ, &hk) == ERROR_SUCCESS) - { - RegCloseKey (hk); - dbg_printf (("found!\n")); - return true; - } + { + RegCloseKey (hk); + dbg_printf (("found!\n")); + return true; + } break; case FILENAME: dbg_printf (("Detect filename '%s'... ", det->param)); if (!expand_path (det->param, expandedname)) - { - printf ("Expansion failure!\n"); - break; - } + { + printf ("Expansion failure!\n"); + break; + } dbg_printf (("('%s' after expansion)... ", expandedname)); fh = CreateFile (expandedname, 0, FILE_SHARE_READ | FILE_SHARE_WRITE - | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, NULL); + | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, NULL); if (fh != INVALID_HANDLE_VALUE) - { - CloseHandle (fh); - dbg_printf (("found!\n")); - return true; - } + { + CloseHandle (fh); + dbg_printf (("found!\n")); + return true; + } break; case PROCESSNAME: @@ -290,26 +290,26 @@ detect_dodgy_app (const struct bad_app_det *det, PSYSTEM_PROCESSES pslist, PSYST ansiname.Buffer = (CHAR *) det->param; rv = RtlAnsiStringToUnicodeString (&unicodename, &ansiname, TRUE); if (rv != STATUS_SUCCESS) - { - printf ("Ansi to unicode conversion failure $%08x\n", (unsigned int) rv); - break; - } + { + printf ("Ansi to unicode conversion failure $%08x\n", (unsigned int) rv); + break; + } found = find_process_in_list (pslist, &unicodename); RtlFreeUnicodeString (&unicodename); if (found) - { - dbg_printf (("found!\n")); - return true; - } + { + dbg_printf (("found!\n")); + return true; + } break; case HOOKDLLNAME: dbg_printf (("Detect hookdll '%s'... ", det->param)); if (find_module_in_list (modlist, det->param)) - { - dbg_printf (("found!\n")); - return true; - } + { + dbg_printf (("found!\n")); + return true; + } break; } @@ -324,7 +324,7 @@ find_dodgy_app_info (enum bad_app which_app) for (i = 0; i < num_of_dodgy_apps; i++) { if (big_list_of_dodgy_apps[i].app_id == which_app) - return &big_list_of_dodgy_apps[i]; + return &big_list_of_dodgy_apps[i]; } return NULL; } @@ -357,50 +357,50 @@ dump_dodgy_apps (int verbose) /* Not found would mean we coded the lists bad. */ assert (found); if (detected) - { - ++n_det; - found->found_it |= (1 << det->type); - } + { + ++n_det; + found->found_it |= (1 << det->type); + } } if (n_det) { printf ("\nPotential app conflicts:\n\n"); for (i = 0; i < num_of_dodgy_apps; i++) - { - if (big_list_of_dodgy_apps[i].found_it) - { - printf ("%s%s", big_list_of_dodgy_apps[i].details, - verbose ? "\nDetected: " : ".\n"); - if (!verbose) - continue; - const char *sep = ""; - if (big_list_of_dodgy_apps[i].found_it & (1 << HKLMKEY)) - { - printf ("HKLM Registry Key"); - sep = ", "; - } - if (big_list_of_dodgy_apps[i].found_it & (1 << HKCUKEY)) - { - printf ("%sHKCU Registry Key", sep); - sep = ", "; - } - if (big_list_of_dodgy_apps[i].found_it & (1 << FILENAME)) - { - printf ("%sNamed file", sep); - sep = ", "; - } - if (big_list_of_dodgy_apps[i].found_it & (1 << PROCESSNAME)) - { - printf ("%sNamed process", sep); - sep = ", "; - } - if (big_list_of_dodgy_apps[i].found_it & (1 << HOOKDLLNAME)) - { - printf ("%sLoaded hook DLL", sep); - } - printf (".\n\n"); - } - } + { + if (big_list_of_dodgy_apps[i].found_it) + { + printf ("%s%s", big_list_of_dodgy_apps[i].details, + verbose ? "\nDetected: " : ".\n"); + if (!verbose) + continue; + const char *sep = ""; + if (big_list_of_dodgy_apps[i].found_it & (1 << HKLMKEY)) + { + printf ("HKLM Registry Key"); + sep = ", "; + } + if (big_list_of_dodgy_apps[i].found_it & (1 << HKCUKEY)) + { + printf ("%sHKCU Registry Key", sep); + sep = ", "; + } + if (big_list_of_dodgy_apps[i].found_it & (1 << FILENAME)) + { + printf ("%sNamed file", sep); + sep = ", "; + } + if (big_list_of_dodgy_apps[i].found_it & (1 << PROCESSNAME)) + { + printf ("%sNamed process", sep); + sep = ", "; + } + if (big_list_of_dodgy_apps[i].found_it & (1 << HOOKDLLNAME)) + { + printf ("%sLoaded hook DLL", sep); + } + printf (".\n\n"); + } + } } /* Tidy up allocations. */ free (pslist); diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 9170d5645..52411c881 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -869,7 +869,7 @@ find_app_on_path (const char *app, bool showall = false) static char tmp[SYMLINK_MAX + 1]; if (!readlink (fh, tmp, SYMLINK_MAX)) display_error("readlink failed"); - + /* Resolve the linkname relative to the directory of the link. */ char *ptr = cygpath_rel (dirname (papp), tmp, NULL); printf (" -> %s\n", ptr); @@ -884,7 +884,7 @@ find_app_on_path (const char *app, bool showall = false) if (!CloseHandle (fh)) display_error ("find_app_on_path: CloseHandle()"); /* FIXME: We leak the ptr returned by cygpath() here which is a - malloc()d string. */ + malloc()d string. */ return find_app_on_path (ptr, showall); } @@ -1250,7 +1250,7 @@ handle_reg_installation (handle_reg_t what) { char *path = data + 4; if (path[1] != ':') - *(path += 2) = '\\'; + *(path += 2) = '\\'; if (what == PRINT_KEY) printf (" %s Key: %s Path: %s", i ? "User: " : "System:", name, path); @@ -1286,20 +1286,20 @@ del_orphaned_reg_installations () /* Unfortunately neither mingw nor Windows know this function. */ char * memmem (char *haystack, size_t haystacklen, - const char *needle, size_t needlelen) + const char *needle, size_t needlelen) { if (needlelen == 0) return haystack; while (needlelen <= haystacklen) { if (!memcmp (haystack, needle, needlelen)) - return haystack; + return haystack; haystack++; haystacklen--; } return NULL; } - + int handle_unique_object_name (int opt, char *path) { @@ -1358,7 +1358,7 @@ handle_unique_object_name (int opt, char *path) else { size_t haystacklen = GetFileSize (fh, NULL); - cygwin_props_t *cygwin_props = (cygwin_props_t *) + cygwin_props_t *cygwin_props = (cygwin_props_t *) memmem ((char *) haystack, haystacklen, CYGWIN_PROPS_MAGIC, sizeof (CYGWIN_PROPS_MAGIC)); if (!cygwin_props) @@ -1449,7 +1449,7 @@ dump_sysinfo () #define PRODUCT_UNLICENSED 0xabcdabcd #define PRODUCT_ULTIMATE_E 0x00000047 const char *products[] = - { + { /* 0x00000000 */ "", /* 0x00000001 */ " Ultimate", /* 0x00000002 */ " Home Basic", @@ -1524,11 +1524,11 @@ dump_sysinfo () /* 0x00000047 */ " Ultimate E" }; if (prod == PRODUCT_UNLICENSED) - strcat (osname, "Unlicensed"); + strcat (osname, "Unlicensed"); else if (prod > PRODUCT_ULTIMATE_E) - strcat (osname, ""); + strcat (osname, ""); else - strcat (osname, products[prod]); + strcat (osname, products[prod]); } else { @@ -1540,7 +1540,7 @@ dump_sysinfo () { strcpy (osname, "2000"); if (osversion.wProductType == VER_NT_WORKSTATION) - strcat (osname, " Professional"); + strcat (osname, " Professional"); else if (osversion.wSuiteMask & VER_SUITE_DATACENTER) strcat (osname, " Datacenter Server"); else if (osversion.wSuiteMask & VER_SUITE_ENTERPRISE) @@ -1566,7 +1566,7 @@ dump_sysinfo () { strcpy (osname, "2003 Server"); if (GetSystemMetrics (SM_SERVERR2)) - strcat (osname, " R2"); + strcat (osname, " R2"); if (osversion.wSuiteMask & VER_SUITE_BLADE) strcat (osname, " Web Edition"); else if (osversion.wSuiteMask & VER_SUITE_DATACENTER) @@ -1574,18 +1574,18 @@ dump_sysinfo () else if (osversion.wSuiteMask & VER_SUITE_ENTERPRISE) strcat (osname, " Enterprise Edition"); else if (osversion.wSuiteMask & VER_SUITE_COMPUTE_SERVER) - strcat (osname, " Compute Cluster Edition"); + strcat (osname, " Compute Cluster Edition"); } } else if (osversion.dwMajorVersion == 4) - { + { strcpy (osname, "NT 4"); if (more_info) { if (osversion.wProductType == VER_NT_WORKSTATION) - strcat (osname, " Workstation"); + strcat (osname, " Workstation"); else - { + { strcat (osname, " Server"); if (osversion.wSuiteMask & VER_SUITE_ENTERPRISE) strcat (osname, " Enterprise Edition"); @@ -1733,12 +1733,12 @@ dump_sysinfo () printf ("Use '-r' to scan registry\n\n"); if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, - "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\kernel", - 0, KEY_READ, &key) == ERROR_SUCCESS) + "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\kernel", + 0, KEY_READ, &key) == ERROR_SUCCESS) { DWORD size; RegQueryValueEx (key, "obcaseinsensitive", NULL, NULL, - (LPBYTE) &obcaseinsensitive, &size); + (LPBYTE) &obcaseinsensitive, &size); RegCloseKey (key); } printf ("obcaseinsensitive set to %lu\n\n", obcaseinsensitive); @@ -1930,7 +1930,7 @@ dump_sysinfo () if (strcasecmp (f, "cygwin1.dll") == 0) { if (!cygwin_dll_count) - strcpy (cygdll_path, pth->dir); + strcpy (cygdll_path, pth->dir); if (!cygwin_dll_count || strcasecmp (cygdll_path, pth->dir) != 0) cygwin_dll_count++; @@ -2184,32 +2184,32 @@ At least one command option or a PROGRAM is required, as shown above.\n\ \n\ PROGRAM list library (DLL) dependencies of PROGRAM\n\ -c, --check-setup show installed version of PACKAGE and verify integrity\n\ - (or for all installed packages if none specified)\n\ + (or for all installed packages if none specified)\n\ -d, --dump-only just list packages, do not verify (with -c)\n\ -s, --sysinfo produce diagnostic system information (implies -c)\n\ -r, --registry also scan registry for Cygwin settings (with -s)\n\ -k, --keycheck perform a keyboard check session (must be run from a\n\ - plain console only, not from a pty/rxvt/xterm)\n\ + plain console only, not from a pty/rxvt/xterm)\n\ -f, --find-package find the package to which FILE belongs\n\ -l, --list-package list contents of PACKAGE (or all packages if none given)\n\ -p, --package-query search for REGEXP in the entire cygwin.com package\n\ - repository (requires internet connectivity)\n\ + repository (requires internet connectivity)\n\ --delete-orphaned-installation-keys\n\ - Delete installation keys of old, now unused\n\ - installations from the registry. Requires the right\n\ - to change the registry.\n\ + Delete installation keys of old, now unused\n\ + installations from the registry. Requires the right\n\ + to change the registry.\n\ --enable-unique-object-names Cygwin-DLL\n\ --disable-unique-object-names Cygwin-DLL\n\ --show-unique-object-names Cygwin-DLL\n\ - Enable, disable, or show the setting of the\n\ - \"unique object names\" setting in the Cygwin DLL\n\ - given as argument to this option. The DLL path must\n\ - be given as valid Windows(!) path.\n\ - See the users guide for more information.\n\ - If you don't know what this means, don't change it.\n\ + Enable, disable, or show the setting of the\n\ + \"unique object names\" setting in the Cygwin DLL\n\ + given as argument to this option. The DLL path must\n\ + be given as valid Windows(!) path.\n\ + See the users guide for more information.\n\ + If you don't know what this means, don't change it.\n\ -v, --verbose produce more verbose output\n\ -h, --help annotate output with explanatory comments when given\n\ - with another command, otherwise print this help\n\ + with another command, otherwise print this help\n\ -V, --version print the version of cygcheck and exit\n\ \n\ Note: -c, -f, and -l only report on packages that are currently installed. To\n\ @@ -2362,12 +2362,12 @@ main (int argc, char **argv) givehelp = 1; break; case CO_DELETE_KEYS: - del_orphaned_reg = 1; + del_orphaned_reg = 1; break; case CO_ENABLE_UON: case CO_DISABLE_UON: case CO_SHOW_UON: - unique_object_name_opt = i; + unique_object_name_opt = i; break; case 'V': print_version (); diff --git a/winsup/utils/cygpath.cc b/winsup/utils/cygpath.cc index 1e7905b51..662112fe5 100644 --- a/winsup/utils/cygpath.cc +++ b/winsup/utils/cygpath.cc @@ -286,7 +286,7 @@ get_device_name (char *path) { /* If there's a trailing path, it's a perfectly valid DOS pathname without the \\.\ prefix. Unless it's - longer than MAX_PATH - 1 in which case it needs + longer than MAX_PATH - 1 in which case it needs the \\?\ prefix. */ if ((len = strlen (ret + 4)) >= MAX_PATH) ret[2] = '?'; diff --git a/winsup/utils/dump_setup.cc b/winsup/utils/dump_setup.cc index b6868e9b3..70f03eed5 100644 --- a/winsup/utils/dump_setup.cc +++ b/winsup/utils/dump_setup.cc @@ -223,7 +223,7 @@ could_not_access (int verbose, char *filename, char *package, const char *type) } static const WCHAR tfx_chars[] = { - 0, 0xf000 | 1, 0xf000 | 2, 0xf000 | 3, + 0, 0xf000 | 1, 0xf000 | 2, 0xf000 | 3, 0xf000 | 4, 0xf000 | 5, 0xf000 | 6, 0xf000 | 7, 0xf000 | 8, 0xf000 | 9, 0xf000 | 10, 0xf000 | 11, 0xf000 | 12, 0xf000 | 13, 0xf000 | 14, 0xf000 | 15, @@ -231,29 +231,29 @@ static const WCHAR tfx_chars[] = { 0xf000 | 20, 0xf000 | 21, 0xf000 | 22, 0xf000 | 23, 0xf000 | 24, 0xf000 | 25, 0xf000 | 26, 0xf000 | 27, 0xf000 | 28, 0xf000 | 29, 0xf000 | 30, 0xf000 | 31, - ' ', '!', 0xf000 | '"', '#', - '$', '%', '&', 39, - '(', ')', 0xf000 | '*', '+', - ',', '-', '.', '\\', - '0', '1', '2', '3', - '4', '5', '6', '7', - '8', '9', 0xf000 | ':', ';', + ' ', '!', 0xf000 | '"', '#', + '$', '%', '&', 39, + '(', ')', 0xf000 | '*', '+', + ',', '-', '.', '\\', + '0', '1', '2', '3', + '4', '5', '6', '7', + '8', '9', 0xf000 | ':', ';', 0xf000 | '<', '=', 0xf000 | '>', 0xf000 | '?', - '@', 'A', 'B', 'C', - 'D', 'E', 'F', 'G', - 'H', 'I', 'J', 'K', - 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', - 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', '[', - '\\', ']', '^', '_', - '`', 'a', 'b', 'c', - 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', - 'l', 'm', 'n', 'o', - 'p', 'q', 'r', 's', - 't', 'u', 'v', 'w', - 'x', 'y', 'z', '{', + '@', 'A', 'B', 'C', + 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', + 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', + 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', + '\\', ']', '^', '_', + '`', 'a', 'b', 'c', + 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', + 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', + 't', 'u', 'v', 'w', + 'x', 'y', 'z', '{', 0xf000 | '|', '}', '~', 127 }; diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc index 6aa5e077e..3b92bcc18 100644 --- a/winsup/utils/dumper.cc +++ b/winsup/utils/dumper.cc @@ -867,14 +867,14 @@ static void print_version () { printf ("dumper (cygwin) %d.%d.%d\n" - "Core Dumper for Cygwin\n" - "Copyright (C) 1999 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Core Dumper for Cygwin\n" + "Copyright (C) 1999 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } int diff --git a/winsup/utils/getconf.c b/winsup/utils/getconf.c index e71c52043..7e0b5f595 100644 --- a/winsup/utils/getconf.c +++ b/winsup/utils/getconf.c @@ -424,20 +424,20 @@ printvar (const struct conf_variable *cp, const char *pathname) errno = 0; slen = confstr ((int) cp->value, NULL, 0); if (slen == 0) - { - if (errno == 0) - print_strvar (cp->name, "undefined"); - return; - } + { + if (errno == 0) + print_strvar (cp->name, "undefined"); + return; + } if ((sval = malloc (slen)) == NULL) - error (EXIT_FAILURE, 0, "Can't allocate %zu bytes", slen); + error (EXIT_FAILURE, 0, "Can't allocate %zu bytes", slen); errno = 0; if (confstr ((int) cp->value, sval, slen) == 0) - print_strvar (cp->name, "undefined"); + print_strvar (cp->name, "undefined"); else - print_strvar (cp->name, sval); + print_strvar (cp->name, sval); free (sval); break; @@ -445,25 +445,25 @@ printvar (const struct conf_variable *cp, const char *pathname) case SYSCONF: errno = 0; if ((val = sysconf ((int) cp->value)) == -1) - { - if (a_flag && errno != 0) - return; /* Just skip invalid variables */ - print_strvar (cp->name, "undefined"); - } + { + if (a_flag && errno != 0) + return; /* Just skip invalid variables */ + print_strvar (cp->name, "undefined"); + } else - print_longvar (cp->name, val); + print_longvar (cp->name, val); break; case PATHCONF: errno = 0; if ((val = pathconf (pathname, (int) cp->value)) == -1) - { - if (a_flag && errno != 0) - return; /* Just skip invalid variables */ - print_strvar (cp->name, "undefined"); - } + { + if (a_flag && errno != 0) + return; /* Just skip invalid variables */ + print_strvar (cp->name, "undefined"); + } else - print_longvar (cp->name, val); + print_longvar (cp->name, val); break; } } @@ -471,7 +471,7 @@ printvar (const struct conf_variable *cp, const char *pathname) static void usage (int ret) { - fprintf (ret ? stderr : stdout, + fprintf (ret ? stderr : stdout, "Usage: %1$s [-v specification] variable_name [pathname]\n" " %1$s -a [pathname]\n" "\n" @@ -493,14 +493,14 @@ static void print_version () { printf ("getconf (cygwin) %d.%d.%d\n" - "Get configuration values\n" - "Copyright (C) 2011 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Get configuration values\n" + "Copyright (C) 2011 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } struct option longopts[] = { @@ -525,23 +525,23 @@ main (int argc, char **argv) while ((ch = getopt_long (argc, argv, opts, longopts, NULL)) != -1) { switch (ch) - { - case 'a': - a_flag = 1; - break; - case 'v': - v_flag = 1; - break; - case 'h': - usage (0); + { + case 'a': + a_flag = 1; + break; + case 'v': + v_flag = 1; + break; + case 'h': + usage (0); case 'V': print_version (); return 0; - default: + default: fprintf (stderr, "Try `%s --help' for more information.\n", program_invocation_short_name); return 1; - } + } } argc -= optind; argv += optind; @@ -549,18 +549,18 @@ main (int argc, char **argv) if (v_flag) { if (a_flag || argc < 2) - usage (1); + usage (1); for (sp = spec_table; sp->name != NULL; sp++) - { - if (strcmp (argv[0], sp->name) == 0) - { - if (sp->valid != 1) - error (EXIT_FAILURE, 0, "unsupported specification \"%s\"", argv[0]); - break; - } - } + { + if (strcmp (argv[0], sp->name) == 0) + { + if (sp->valid != 1) + error (EXIT_FAILURE, 0, "unsupported specification \"%s\"", argv[0]); + break; + } + } if (sp->name == NULL) - error (EXIT_FAILURE, 0, "unknown specification \"%s\"", argv[0]); + error (EXIT_FAILURE, 0, "unknown specification \"%s\"", argv[0]); argc--; argv++; } @@ -568,7 +568,7 @@ main (int argc, char **argv) if (!a_flag) { if (argc == 0) - usage (1); + usage (1); varname = argv[0]; argc--; argv++; @@ -584,16 +584,16 @@ main (int argc, char **argv) for (cp = conf_table; cp->name != NULL; cp++) { if (a_flag || strcmp (varname, cp->name) == 0) - { - /* LINTED weird expression */ - if ((cp->type == PATHCONF) == (pathname != NULL)) - { - printvar (cp, pathname); - found = 1; - } - else if (!a_flag) - usage (1); - } + { + /* LINTED weird expression */ + if ((cp->type == PATHCONF) == (pathname != NULL)) + { + printvar (cp, pathname); + found = 1; + } + else if (!a_flag) + usage (1); + } } if (!a_flag && !found) diff --git a/winsup/utils/getfacl.c b/winsup/utils/getfacl.c index 455431343..cbde4668a 100644 --- a/winsup/utils/getfacl.c +++ b/winsup/utils/getfacl.c @@ -66,47 +66,47 @@ static void usage (FILE * stream) { fprintf (stream, "Usage: %s [-adn] FILE [FILE2...]\n" - "\n" - "Display file and directory access control lists (ACLs).\n" - "\n" - " -a, --all display the filename, the owner, the group, and\n" - " the ACL of the file\n" - " -d, --dir display the filename, the owner, the group, and\n" - " the default ACL of the directory, if it exists\n" - " -h, --help output usage information and exit\n" - " -n, --noname display user and group IDs instead of names\n" - " -V, --version output version information and exit\n" - "\n" - "When multiple files are specified on the command line, a blank\n" - "line separates the ACLs for each file.\n", prog_name); - if (stream == stdout) + "\n" + "Display file and directory access control lists (ACLs).\n" + "\n" + " -a, --all display the filename, the owner, the group, and\n" + " the ACL of the file\n" + " -d, --dir display the filename, the owner, the group, and\n" + " the default ACL of the directory, if it exists\n" + " -h, --help output usage information and exit\n" + " -n, --noname display user and group IDs instead of names\n" + " -V, --version output version information and exit\n" + "\n" + "When multiple files are specified on the command line, a blank\n" + "line separates the ACLs for each file.\n", prog_name); + if (stream == stdout) { fprintf (stream, "" - "For each argument that is a regular file, special file or\n" - "directory, getfacl displays the owner, the group, and the ACL.\n" - "For directories getfacl displays additionally the default ACL.\n" - "\n" - "With no options specified, getfacl displays the filename, the\n" - "owner, the group, and both the ACL and the default ACL, if it\n" - "exists.\n" - "\n" - "The format for ACL output is as follows:\n" - " # file: filename\n" - " # owner: name or uid\n" - " # group: name or uid\n" - " user::perm\n" - " user:name or uid:perm\n" - " group::perm\n" - " group:name or gid:perm\n" - " mask:perm\n" - " other:perm\n" - " default:user::perm\n" - " default:user:name or uid:perm\n" - " default:group::perm\n" - " default:group:name or gid:perm\n" - " default:mask:perm\n" - " default:other:perm\n" - "\n"); + "For each argument that is a regular file, special file or\n" + "directory, getfacl displays the owner, the group, and the ACL.\n" + "For directories getfacl displays additionally the default ACL.\n" + "\n" + "With no options specified, getfacl displays the filename, the\n" + "owner, the group, and both the ACL and the default ACL, if it\n" + "exists.\n" + "\n" + "The format for ACL output is as follows:\n" + " # file: filename\n" + " # owner: name or uid\n" + " # group: name or uid\n" + " user::perm\n" + " user:name or uid:perm\n" + " group::perm\n" + " group:name or gid:perm\n" + " mask:perm\n" + " other:perm\n" + " default:user::perm\n" + " default:user:name or uid:perm\n" + " default:group::perm\n" + " default:group:name or gid:perm\n" + " default:mask:perm\n" + " default:other:perm\n" + "\n"); } } @@ -124,14 +124,14 @@ static void print_version () { printf ("getfacl (cygwin) %d.%d.%d\n" - "Get POSIX ACL information\n" - "Copyright (C) 2000 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Get POSIX ACL information\n" + "Copyright (C) 2000 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } int @@ -187,12 +187,12 @@ main (int argc, char **argv) } printf ("# file: %s\n", argv[optind]); if (nopt) - { + { printf ("# owner: %lu\n", (unsigned long)st.st_uid); printf ("# group: %lu\n", (unsigned long)st.st_gid); } else - { + { printf ("# owner: %s\n", username (st.st_uid)); printf ("# group: %s\n", groupname (st.st_gid)); } diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc index a223e7f9d..a65c0463e 100644 --- a/winsup/utils/kill.cc +++ b/winsup/utils/kill.cc @@ -56,14 +56,14 @@ static void print_version () { printf ("kill (cygwin) %d.%d.%d\n" - "Process Signaller\n" - "Copyright (C) 1996 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Process Signaller\n" + "Copyright (C) 1996 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } static const char * @@ -135,7 +135,7 @@ get_debug_priv (void) TOKEN_PRIVILEGES tkp; if (!OpenProcessToken (GetCurrentProcess (), - TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &tok)) + TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &tok)) return; if (!LookupPrivilegeValue (NULL, SE_DEBUG_NAME, &luid)) @@ -167,15 +167,15 @@ forcekill (int pid, int sig, int wait) HANDLE h = OpenProcess (PROCESS_TERMINATE, FALSE, (DWORD) dwpid); if (!h) { - if (!wait || GetLastError () != ERROR_INVALID_PARAMETER) - fprintf (stderr, "%s: couldn't open pid %u\n", - prog_name, (unsigned) dwpid); + if (!wait || GetLastError () != ERROR_INVALID_PARAMETER) + fprintf (stderr, "%s: couldn't open pid %u\n", + prog_name, (unsigned) dwpid); return; } if (!wait || WaitForSingleObject (h, 200) != WAIT_OBJECT_0) if (sig && !TerminateProcess (h, sig << 8) && WaitForSingleObject (h, 200) != WAIT_OBJECT_0) - fprintf (stderr, "%s: couldn't kill pid %u, %lu\n", + fprintf (stderr, "%s: couldn't kill pid %u, %lu\n", prog_name, (unsigned) dwpid, GetLastError ()); CloseHandle (h); } @@ -259,8 +259,8 @@ out: if (!pid) pid = strtoll (*argv, &p, 10); if (*p != '\0' - || (!force && (pid < LONG_MIN || pid > LONG_MAX)) - || (force && (pid <= 0 || pid > ULONG_MAX))) + || (!force && (pid < LONG_MIN || pid > LONG_MAX)) + || (force && (pid <= 0 || pid > ULONG_MAX))) { fprintf (stderr, "%s: illegal pid: %s\n", prog_name, *argv); ret = 1; diff --git a/winsup/utils/ldd.cc b/winsup/utils/ldd.cc index 018cdccb3..6cefeb8af 100644 --- a/winsup/utils/ldd.cc +++ b/winsup/utils/ldd.cc @@ -93,14 +93,14 @@ static void print_version () { printf ("ldd (cygwin) %d.%d.%d\n" - "Print shared library dependencies\n" - "Copyright (C) 2009 - %s Chris Faylor\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Print shared library dependencies\n" + "Copyright (C) 2009 - %s Chris Faylor\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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } #define print_errno_error_and_return(__fn) \ @@ -439,7 +439,7 @@ dump_import_directory (const void *const section_base, int len = mbstowcs (NULL, fn, 0); if (len <= 0) - continue; + continue; wchar_t fnw[len + 1]; mbstowcs (fnw, fn, len + 1); /* output DLL's name */ @@ -492,7 +492,7 @@ map_file (const wchar_t *filename) CloseHandle (hFile); return 0; } - + CloseHandle (hMapping); CloseHandle (hFile); @@ -658,7 +658,7 @@ process_file (const wchar_t *filename) UnmapViewOfFile (basepointer); return 8; } - + UnmapViewOfFile (basepointer); return 0; } diff --git a/winsup/utils/loadlib.h b/winsup/utils/loadlib.h index 7f3a9cc2b..b2da8c76d 100644 --- a/winsup/utils/loadlib.h +++ b/winsup/utils/loadlib.h @@ -49,7 +49,7 @@ _load_sys_library (const wchar_t *dll) if (wcscmp (dll, L"cygwin1.dll") == 0) return LoadLibraryExW (L"cygwin1.dll", NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - + wcscpy (dllpath, sysdir); wcscpy (dllpath + sysdir_len, dll); return LoadLibraryExW (dllpath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); diff --git a/winsup/utils/locale.cc b/winsup/utils/locale.cc index 572ed4bcf..e3c39c049 100644 --- a/winsup/utils/locale.cc +++ b/winsup/utils/locale.cc @@ -251,17 +251,17 @@ add_locale_alias_locales () alias_buf[LOCALE_ALIAS_LINE_LEN] = '\0'; c = strrchr (alias_buf, '\n'); if (c) - *c = '\0'; + *c = '\0'; c = alias_buf; c += strspn (c, " \t"); if (!*c || *c == '#') - continue; + continue; alias = c; c += strcspn (c, " \t"); *c++ = '\0'; c += strspn (c, " \t"); if (*c == '#') - continue; + continue; replace = c; c += strcspn (c, " \t"); *c++ = '\0'; @@ -524,7 +524,7 @@ print_lc_sepstrings (int key, const char *name, const char *value) if (key) fputc ('"', stdout); if (value && *value) - fputc (';', stdout); + fputc (';', stdout); } fputc ('\n', stdout); } @@ -693,7 +693,7 @@ print_lc (int cat, int key, const char *category, const char *name, for (lc_names_t *lc = lc_name; lc->type != is_end; ++lc) if (!name || !strcmp (name, lc->name)) switch (lc->type) - { + { case is_string_fake: print_lc_svalue (key, lc->name, fake_string[lc->fromval + key]); break; @@ -746,14 +746,14 @@ print_names (int cat, int key, const char *name) for (c = categories; c->category; ++c) if (!strcmp (name, c->category)) { - print_lc (cat, key, c->category, NULL, c->lc_names); + print_lc (cat, key, c->category, NULL, c->lc_names); return; } for (c = categories; c->category; ++c) for (lc = c->lc_names; lc->type != is_end; ++lc) if (!strcmp (name, lc->name)) { - print_lc (cat, key, c->category, lc->name, lc); + print_lc (cat, key, c->category, lc->name, lc); return; } } @@ -789,31 +789,31 @@ main (int argc, char **argv) switch (opt) { case 'a': - all = 1; + all = 1; break; case 'c': - cat = 1; + cat = 1; break; case 'k': - key = 1; + key = 1; break; case 'm': maps = 1; break; case 's': - lcid = GetSystemDefaultUILanguage (); + lcid = GetSystemDefaultUILanguage (); break; case 'u': - lcid = GetUserDefaultUILanguage (); + lcid = GetUserDefaultUILanguage (); break; case 'f': - lcid = GetUserDefaultLCID (); + lcid = GetUserDefaultLCID (); break; case 'n': - lcid = GetSystemDefaultLCID (); + lcid = GetSystemDefaultLCID (); break; case 'U': - utf = ".UTF-8"; + utf = ".UTF-8"; break; case 'v': verbose = 1; diff --git a/winsup/utils/mkgroup.c b/winsup/utils/mkgroup.c index 2297a5149..393d8f8f7 100644 --- a/winsup/utils/mkgroup.c +++ b/winsup/utils/mkgroup.c @@ -668,14 +668,14 @@ static void print_version () { printf ("mkgroup (cygwin) %d.%d.%d\n" - "Group File Generator\n" - "Copyright (C) 1997 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Group File Generator\n" + "Copyright (C) 1997 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } static PPOLICY_PRIMARY_DOMAIN_INFO p_dom; diff --git a/winsup/utils/mkpasswd.c b/winsup/utils/mkpasswd.c index 33bc408c8..c873664f9 100644 --- a/winsup/utils/mkpasswd.c +++ b/winsup/utils/mkpasswd.c @@ -570,14 +570,14 @@ static void print_version () { printf ("mkpasswd (cygwin) %d.%d.%d\n" - "Passwd File Generator\n" - "Copyright (C) 1997 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Passwd File Generator\n" + "Copyright (C) 1997 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } static void diff --git a/winsup/utils/mount.cc b/winsup/utils/mount.cc index c502be34a..0995f3462 100644 --- a/winsup/utils/mount.cc +++ b/winsup/utils/mount.cc @@ -240,14 +240,14 @@ static void print_version () { printf ("mount (cygwin) %d.%d.%d\n" - "Mount filesystem utility\n" - "Copyright (C) 1996 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Mount filesystem utility\n" + "Copyright (C) 1996 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } static char * @@ -366,7 +366,7 @@ main (int argc, char **argv) break; case saw_mount_all: if (optind <= argc) - usage (); + usage (); do_mount_from_fstab (NULL); break; default: @@ -436,7 +436,7 @@ mount_entries (void) { char *noumount; if ((noumount = strstr (p->mnt_opts, ",noumount"))) - { + { char dirname[NT_MAX_PATH]; char opts[strlen (p->mnt_opts) + 1]; @@ -456,7 +456,7 @@ mount_entries (void) } } endmntent (m); - + exit(0); } diff --git a/winsup/utils/passwd.c b/winsup/utils/passwd.c index c92a26bf7..cd2ca47bd 100644 --- a/winsup/utils/passwd.c +++ b/winsup/utils/passwd.c @@ -83,9 +83,9 @@ EvalRet (int ret, const char *user) case ERROR_ACCESS_DENIED: if (! user) - eprint (0, "You may not change password expiry information."); + eprint (0, "You may not change password expiry information."); else - eprint (0, "You may not change the password for %s.", user); + eprint (0, "You may not change the password for %s.", user); break; eprint (0, "Bad password: Invalid."); @@ -121,7 +121,7 @@ GetPW (char *user, int print_win_name, LPCWSTR server) PUSER_INFO_3 ui; struct passwd *pw; char *domain = (char *) alloca (INTERNET_MAX_HOST_NAME_LENGTH + 1); - + /* Try getting a Win32 username in case the user edited /etc/passwd */ if ((pw = getpwnam (user))) { @@ -180,13 +180,13 @@ PrintPW (PUSER_INFO_3 ui, LPCWSTR server) PUSER_MODALS_INFO_0 mi; printf ("Account disabled : %s", - (ui->usri3_flags & UF_ACCOUNTDISABLE) ? "yes\n" : "no\n"); + (ui->usri3_flags & UF_ACCOUNTDISABLE) ? "yes\n" : "no\n"); printf ("Password not required : %s", - (ui->usri3_flags & UF_PASSWD_NOTREQD) ? "yes\n" : "no\n"); + (ui->usri3_flags & UF_PASSWD_NOTREQD) ? "yes\n" : "no\n"); printf ("User can't change password : %s", - (ui->usri3_flags & UF_PASSWD_CANT_CHANGE) ? "yes\n" : "no\n"); + (ui->usri3_flags & UF_PASSWD_CANT_CHANGE) ? "yes\n" : "no\n"); printf ("Password never expires : %s", - (ui->usri3_flags & UF_DONT_EXPIRE_PASSWD) ? "yes\n" : "no\n"); + (ui->usri3_flags & UF_DONT_EXPIRE_PASSWD) ? "yes\n" : "no\n"); printf ("Password expired : %s", (ui->usri3_password_expired) ? "yes\n" : "no\n"); printf ("Latest password change : %s", ctime(&t)); @@ -194,22 +194,22 @@ PrintPW (PUSER_INFO_3 ui, LPCWSTR server) if (! ret) { if (mi->usrmod0_max_passwd_age == TIMEQ_FOREVER) - mi->usrmod0_max_passwd_age = 0; + mi->usrmod0_max_passwd_age = 0; if (mi->usrmod0_min_passwd_age == TIMEQ_FOREVER) - mi->usrmod0_min_passwd_age = 0; + mi->usrmod0_min_passwd_age = 0; if (mi->usrmod0_force_logoff == TIMEQ_FOREVER) - mi->usrmod0_force_logoff = 0; + mi->usrmod0_force_logoff = 0; if (ui->usri3_priv == USER_PRIV_ADMIN) - mi->usrmod0_min_passwd_len = 0; + mi->usrmod0_min_passwd_len = 0; printf ("\nSystem password settings:\n"); printf ("Max. password age %ld days\n", - mi->usrmod0_max_passwd_age / ONE_DAY); + mi->usrmod0_max_passwd_age / ONE_DAY); printf ("Min. password age %ld days\n", - mi->usrmod0_min_passwd_age / ONE_DAY); + mi->usrmod0_min_passwd_age / ONE_DAY); printf ("Force logout after %ld days\n", - mi->usrmod0_force_logoff / ONE_DAY); + mi->usrmod0_force_logoff / ONE_DAY); printf ("Min. password length: %ld\n", - mi->usrmod0_min_passwd_len); + mi->usrmod0_min_passwd_len); } } @@ -312,7 +312,7 @@ caller_is_admin () DWORD size; PTOKEN_GROUPS grps; SID_IDENTIFIER_AUTHORITY nt_auth = {SECURITY_NT_AUTHORITY}; - PSID admin_grp; + PSID admin_grp; DWORD i; if (is_admin == -1) @@ -351,14 +351,14 @@ static void print_version () { printf ("passwd (cygwin) %d.%d.%d\n" - "Password Utility\n" - "Copyright (C) 1999 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Password Utility\n" + "Copyright (C) 1999 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } int @@ -398,20 +398,20 @@ main (int argc, char **argv) { case 'h': usage (stdout, 0); - break; + break; case 'i': if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt || Sopt || Ropt) usage (stderr, 1); if ((iarg = atoi (optarg)) < 0 || iarg > 999) return eprint (1, "Force logout time must be between 0 and 999."); - break; + break; case 'l': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || uopt || Sopt || Ropt) usage (stderr, 1); lopt = 1; - break; + break; case 'n': if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt || Sopt || Ropt) @@ -420,29 +420,29 @@ main (int argc, char **argv) return eprint (1, "Minimum password age must be between 0 and 999."); if (xarg >= 0 && narg > xarg) return eprint (1, "Minimum password age must be less than " - "maximum password age."); - break; + "maximum password age."); + break; case 'u': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || lopt || Sopt || Ropt) usage (stderr, 1); uopt = 1; - break; + break; case 'c': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || Sopt || Ropt) usage (stderr, 1); copt = 1; - break; + break; case 'C': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || Sopt || Ropt) usage (stderr, 1); Copt = 1; - break; + break; case 'd': - { + { if (Ropt) usage (stderr, 1); char *tmpbuf = alloca (strlen (optarg) + 3); @@ -461,30 +461,30 @@ main (int argc, char **argv) if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || Sopt || Ropt) usage (stderr, 1); eopt = 1; - break; + break; case 'E': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || Sopt || Ropt) usage (stderr, 1); Eopt = 1; - break; + break; case 'p': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || Sopt || Ropt) usage (stderr, 1); popt = 1; - break; + break; case 'P': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || Sopt || Ropt) usage (stderr, 1); Popt = 1; - break; + break; case 'V': print_version (); - exit (0); - break; + exit (0); + break; case 'x': if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt || Sopt || Ropt) @@ -493,23 +493,23 @@ main (int argc, char **argv) return eprint (1, "Maximum password age must be between 0 and 999."); if (narg >= 0 && xarg < narg) return eprint (1, "Maximum password age must be greater than " - "minimum password age."); - break; + "minimum password age."); + break; case 'L': if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt || Sopt || Ropt) usage (stderr, 1); if ((Larg = atoi (optarg)) < 0 || Larg > LM20_PWLEN) return eprint (1, "Minimum password length must be between " - "0 and %d.", LM20_PWLEN); - break; + "0 and %d.", LM20_PWLEN); + break; case 'S': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt || Ropt) usage (stderr, 1); Sopt = 1; - break; + break; case 'R': if (xarg >= 0 || narg >= 0 || iarg >= 0 || Larg >= 0 || lopt || uopt @@ -517,10 +517,10 @@ main (int argc, char **argv) || server) usage (stderr, 1); Ropt = 1; - break; + break; default: - fprintf (stderr, "Try `%s --help' for more information.\n", prog_name); + fprintf (stderr, "Try `%s --help' for more information.\n", prog_name); return 1; } @@ -559,7 +559,7 @@ main (int argc, char **argv) "You can delete the stored password by specifying an empty password.\n\n"); strcpy (newpwd, getpass (text1)); if (strcmp (newpwd, getpass (text2))) - eprint (0, "Password is not identical."); + eprint (0, "Password is not identical."); else if (cygwin_internal (CW_SET_PRIV_KEY, newpwd, username)) return eprint (0, "Storing password failed: %s", strerror (errno)); return 0; @@ -568,7 +568,7 @@ main (int argc, char **argv) if (Larg >= 0 || xarg >= 0 || narg >= 0 || iarg >= 0) { if (optind < argc) - usage (stderr, 1); + usage (stderr, 1); return SetModals (xarg, narg, iarg, Larg, server); } @@ -597,31 +597,31 @@ main (int argc, char **argv) uif.usri1008_flags = ui->usri3_flags; if (lopt) - { + { if (ui->usri3_priv == USER_PRIV_ADMIN) return eprint (0, "Locking an admin account is disallowed."); - uif.usri1008_flags |= UF_ACCOUNTDISABLE; - } + uif.usri1008_flags |= UF_ACCOUNTDISABLE; + } if (uopt) - uif.usri1008_flags &= ~UF_ACCOUNTDISABLE; + uif.usri1008_flags &= ~UF_ACCOUNTDISABLE; if (copt) - uif.usri1008_flags |= UF_PASSWD_CANT_CHANGE; + uif.usri1008_flags |= UF_PASSWD_CANT_CHANGE; if (Copt) - uif.usri1008_flags &= ~UF_PASSWD_CANT_CHANGE; + uif.usri1008_flags &= ~UF_PASSWD_CANT_CHANGE; if (eopt) - uif.usri1008_flags |= UF_DONT_EXPIRE_PASSWD; + uif.usri1008_flags |= UF_DONT_EXPIRE_PASSWD; if (Eopt) - uif.usri1008_flags &= ~UF_DONT_EXPIRE_PASSWD; + uif.usri1008_flags &= ~UF_DONT_EXPIRE_PASSWD; if (popt) - uif.usri1008_flags |= UF_PASSWD_NOTREQD; + uif.usri1008_flags |= UF_PASSWD_NOTREQD; if (Popt) - uif.usri1008_flags &= ~UF_PASSWD_NOTREQD; + uif.usri1008_flags &= ~UF_PASSWD_NOTREQD; if (lopt || uopt || copt || Copt || eopt || Eopt || popt || Popt) { - ret = NetUserSetInfo (server, ui->usri3_name, 1008, (LPBYTE) &uif, - NULL); - return EvalRet (ret, NULL); + ret = NetUserSetInfo (server, ui->usri3_name, 1008, (LPBYTE) &uif, + NULL); + return EvalRet (ret, NULL); } // Sopt PrintPW (ui, server); @@ -639,18 +639,18 @@ main (int argc, char **argv) { strcpy (oldpwd, getpass ("Old password: ")); if (ChangePW (user, oldpwd, oldpwd, 1, server)) - return 1; + return 1; } do { strcpy (newpwd, getpass ("New password: ")); if (strcmp (newpwd, getpass ("Re-enter new password: "))) - eprint (0, "Password is not identical."); + eprint (0, "Password is not identical."); else if (! ChangePW (user, *oldpwd ? oldpwd : NULL, newpwd, 0, server)) - ret = 1; + ret = 1; if (! ret && cnt < 2) - eprint (0, "Try again."); + eprint (0, "Try again."); } while (! ret && ++cnt < 3); return ! ret; diff --git a/winsup/utils/path.cc b/winsup/utils/path.cc index eaebb6cd1..5f4cf6f15 100644 --- a/winsup/utils/path.cc +++ b/winsup/utils/path.cc @@ -199,24 +199,24 @@ readlink (HANDLE fh, char *path, int maxlen) || !ReadFile (fh, buf, fi.nFileSizeLow, &rv, NULL) || rv != fi.nFileSizeLow) return false; - + if (fi.nFileSizeLow > sizeof (file_header) && cmp_shortcut_header (file_header)) { cp = buf + sizeof (win_shortcut_hdr); if (file_header->flags & WSH_FLAG_IDLIST) /* Skip ITEMIDLIST */ - cp += *(unsigned short *) cp + 2; + cp += *(unsigned short *) cp + 2; if (!(len = *(unsigned short *) cp)) - return false; + return false; cp += 2; /* Has appended full path? If so, use it instead of description. */ unsigned short relpath_len = *(unsigned short *) (cp + len); if (cp + len + 2 + relpath_len < buf + fi.nFileSizeLow) - { - cp += len + 2 + relpath_len; - len = *(unsigned short *) cp; - cp += 2; - } + { + cp += len + 2 + relpath_len; + len = *(unsigned short *) cp; + cp += 2; + } if (*(PWCHAR) cp == 0xfeff) /* BOM */ { len = wcstombs (NULL, (wchar_t *) (cp + 2), 0); @@ -225,14 +225,14 @@ readlink (HANDLE fh, char *path, int maxlen) wcstombs (path, (wchar_t *) (cp + 2), len + 1); } else if (len + 1 > maxlen) - return false; + return false; else memcpy (path, cp, len); path[len] = '\0'; return true; } else if (strncmp (buf, SYMLINK_COOKIE, strlen (SYMLINK_COOKIE)) == 0 - && buf[fi.nFileSizeLow - 1] == '\0') + && buf[fi.nFileSizeLow - 1] == '\0') { cp = buf + strlen (SYMLINK_COOKIE); if (*(PWCHAR) cp == 0xfeff) /* BOM */ @@ -247,7 +247,7 @@ readlink (HANDLE fh, char *path, int maxlen) else strcpy (path, cp); return true; - } + } else return false; } @@ -333,21 +333,21 @@ read_flags (char *options, unsigned &flags) { char *p = strchr (options, ','); if (p) - *p++ = '\0'; + *p++ = '\0'; else - p = strchr (options, '\0'); + p = strchr (options, '\0'); for (opt *o = oopts; - o < (oopts + (sizeof (oopts) / sizeof (oopts[0]))); - o++) - if (strcmp (options, o->name) == 0) - { - if (o->clear) - flags &= ~o->val; - else - flags |= o->val; - goto gotit; - } + o < (oopts + (sizeof (oopts) / sizeof (oopts[0]))); + o++) + if (strcmp (options, o->name) == 0) + { + if (o->clear) + flags &= ~o->val; + else + flags |= o->val; + goto gotit; + } return false; gotit: @@ -405,7 +405,7 @@ from_fstab_line (mnt_t *m, char *line, bool user) { if ((mount_flags & MOUNT_SYSTEM) || !(sm->flags & MOUNT_SYSTEM)) { - if (sm->posix) + if (sm->posix) free (sm->posix); sm->posix = strdup (posix_path); sm->flags = mount_flags | MOUNT_CYGDRIVE; @@ -428,7 +428,7 @@ from_fstab_line (mnt_t *m, char *line, bool user) continue; /* Changing immutable mount points require the override flag. */ if ((sm->flags & MOUNT_IMMUTABLE) - && !(mount_flags & MOUNT_OVERRIDE)) + && !(mount_flags & MOUNT_OVERRIDE)) return false; if (mount_flags & MOUNT_OVERRIDE) mount_flags |= MOUNT_IMMUTABLE; @@ -475,9 +475,9 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end) unconvert_slashes (buf); char *native_path = buf; if (!strncmp (native_path, "\\\\?\\", 4)) - native_path += 4; + native_path += 4; if (!strncmp (native_path, "UNC\\", 4)) - *(native_path += 2) = '\\'; + *(native_path += 2) = '\\'; m->posix = strdup ("/"); m->native = strdup (native_path); m->flags = MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_IMMUTABLE @@ -496,8 +496,8 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end) m->flags = MOUNT_SYSTEM | MOUNT_BINARY | MOUNT_AUTOMATIC; ++m; /* Create a default cygdrive entry. Note that this is a user entry. - This allows to override it with mount, unless the sysadmin created - a cygdrive entry in /etc/fstab. */ + This allows to override it with mount, unless the sysadmin created + a cygdrive entry in /etc/fstab. */ m->posix = strdup (CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX); m->native = strdup ("cygdrive prefix"); m->flags = MOUNT_BINARY | MOUNT_CYGDRIVE; @@ -509,14 +509,14 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end) if (user) mbstowcs (wcscpy (u, L".d\\") + 3, get_user (), BUFSIZE - (u - path)); HANDLE h = CreateFileW (path, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) return; char *got = buf; DWORD len = 0; /* Using BUFSIZE-1 leaves space to append two \0. */ while (ReadFile (h, got, BUFSIZE - 1 - (got - buf), - &len, NULL)) + &len, NULL)) { char *end; @@ -527,17 +527,17 @@ from_fstab (bool user, PWCHAR path, PWCHAR path_end) /* Reset got to start reading at the start of the buffer again. */ got = buf; while (got < buf + len && (end = strchr (got, '\n'))) - { - end[end[-1] == '\r' ? -1 : 0] = '\0'; - if (from_fstab_line (m, got, user)) - ++m; - got = end + 1; - } + { + end[end[-1] == '\r' ? -1 : 0] = '\0'; + if (from_fstab_line (m, got, user)) + ++m; + got = end + 1; + } if (len < BUFSIZE - 1) - break; + break; /* We have to read once more. Move remaining bytes to the start of - the buffer and reposition got so that it points to the end of - the remaining bytes. */ + the buffer and reposition got so that it points to the end of + the remaining bytes. */ len = buf + len - got; memmove (buf, got, len); got = buf + len; @@ -559,7 +559,7 @@ mnt_sort (const void *a, const void *b) const mnt_t *ma = (const mnt_t *) a; const mnt_t *mb = (const mnt_t *) b; int ret; - + ret = (ma->flags & MOUNT_CYGDRIVE) - (mb->flags & MOUNT_CYGDRIVE); if (ret) return ret; @@ -768,7 +768,7 @@ rel_vconcat (const char *cwd, const char *s, va_list v) if (!cwd || *cwd == '\0') { if (!GetCurrentDirectory (MAX_PATH, pathbuf)) - return NULL; + return NULL; cwd = pathbuf; } @@ -878,9 +878,9 @@ char * cygpath (const char *s, ...) { va_list v; - + va_start (v, s); - + return vcygpath (NULL, s, v); } diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc index f91849a9b..fad0cb867 100644 --- a/winsup/utils/ps.cc +++ b/winsup/utils/ps.cc @@ -133,14 +133,14 @@ static void print_version () { printf ("ps (cygwin) %d.%d.%d\n" - "Show process statistics\n" - "Copyright (C) 1996 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Show process statistics\n" + "Copyright (C) 1996 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } char dosdevs[32000]; @@ -279,7 +279,7 @@ main (int argc, char *argv[]) status = 'O'; /* Maximum possible path length under NT. There's no official define - for that value. */ + for that value. */ char pname[NT_MAX_PATH + sizeof (" ")]; if (p->ppid) { @@ -355,7 +355,7 @@ main (int argc, char *argv[]) if (!n || !GetModuleFileNameExW (h, hm[0], pwname, NT_MAX_PATH)) strcpy (pname, "*** unknown ***"); else - wcstombs (pname, pwname, NT_MAX_PATH); + wcstombs (pname, pwname, NT_MAX_PATH); } FILETIME ct, et, kt, ut; if (GetProcessTimes (h, &ct, &et, &kt, &ut)) diff --git a/winsup/utils/regtool.cc b/winsup/utils/regtool.cc index 501fff36c..cc28d485e 100644 --- a/winsup/utils/regtool.cc +++ b/winsup/utils/regtool.cc @@ -179,14 +179,14 @@ static void print_version () { printf ("regtool (cygwin) %d.%d.%d\n" - "Registry tool\n" - "Copyright (C) 2000 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Registry tool\n" + "Copyright (C) 2000 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } void @@ -420,18 +420,18 @@ find_key (int howmanyparts, REGSAM access, int option = 0) if (RegCreateKeyExW (base, name, 0, NULL, option, access | wow64, NULL, &key2, NULL) == ERROR_SUCCESS) - { + { if (rv == ERROR_SUCCESS) RegCloseKey (key); key = key2; rv = ERROR_SUCCESS; - } + } } if (rv != ERROR_SUCCESS) Fail (rv); } else if (argv[1]) - { + { ssize_t len = cygwin_conv_path (CCP_POSIX_TO_WIN_W, argv[1], NULL, 0); wchar_t win32_path[len]; cygwin_conv_path (CCP_POSIX_TO_WIN_W, argv[1], win32_path, len); @@ -442,7 +442,7 @@ find_key (int howmanyparts, REGSAM access, int option = 0) printf ("key %ls loaded from file %ls\n", name, win32_path); } else - { + { rv = RegUnLoadKeyW (base, name); if (rv != ERROR_SUCCESS) Fail (rv); @@ -587,7 +587,7 @@ cmd_remove () { HMODULE mod = LoadLibrary ("advapi32.dll"); if (mod) - regDeleteKeyEx = (WINADVAPI LONG WINAPI (*)(HKEY, LPCWSTR, REGSAM, DWORD)) GetProcAddress (mod, "RegDeleteKeyExW"); + regDeleteKeyEx = (WINADVAPI LONG WINAPI (*)(HKEY, LPCWSTR, REGSAM, DWORD)) GetProcAddress (mod, "RegDeleteKeyExW"); } if (regDeleteKeyEx) rv = (*regDeleteKeyEx) (key, value, wow64, 0); @@ -639,7 +639,7 @@ cmd_set () case REG_NONE: case REG_BINARY: for (n = 0; argv[n+1]; n++) - ; + ; if (n == 1 && strcmp (argv[1], "-") == 0) { /* read from stdin */ i = n = 0; @@ -720,7 +720,7 @@ cmd_set () rv = ERROR_INVALID_CATEGORY; break; } - + if (data) free(data); diff --git a/winsup/utils/setfacl.c b/winsup/utils/setfacl.c index 857be7971..66739c043 100644 --- a/winsup/utils/setfacl.c +++ b/winsup/utils/setfacl.c @@ -56,7 +56,7 @@ mode_t getperm (char *in) { int i = atoi (in); if (i < 0 || i > 7) - return ILLEGAL_MODE; + return ILLEGAL_MODE; return i << 6 | i << 3 | i; } if (strlen (in) > 3 && strchr (" \t\n\r#", in[3])) @@ -68,8 +68,8 @@ mode_t getperm (char *in) || !strchr ("x-", in[2])) return ILLEGAL_MODE; return (in[0] == 'r' ? S_IROTH : 0) - | (in[1] == 'w' ? S_IWOTH : 0) - | (in[2] == 'x' ? S_IXOTH : 0); + | (in[1] == 'w' ? S_IWOTH : 0) + | (in[2] == 'x' ? S_IXOTH : 0); } BOOL @@ -127,34 +127,34 @@ getaclentry (action_t action, char *c, aclent_t *ace) can't be deleted. */ c2 = strchrnul (c + 1, ':'); if (*c2 == ':') - *c2++ = '\0'; + *c2++ = '\0'; else if (action != Delete) return FALSE; else if (!(ace->a_type & ACL_DEFAULT)) return FALSE; /* Fetch user/group id. */ if (isdigit ((unsigned char) *c)) - { - char *c3; + { + char *c3; - ace->a_id = strtol (c, &c3, 10); - if (*c3) - return FALSE; - } + ace->a_id = strtol (c, &c3, 10); + if (*c3) + return FALSE; + } else if (ace->a_type & USER_OBJ) - { - struct passwd *pw = getpwnam (c); - if (!pw) - return FALSE; - ace->a_id = pw->pw_uid; - } + { + struct passwd *pw = getpwnam (c); + if (!pw) + return FALSE; + ace->a_id = pw->pw_uid; + } else - { - struct group *gr = getgrnam (c); - if (!gr) - return FALSE; - ace->a_id = gr->gr_gid; - } + { + struct group *gr = getgrnam (c); + if (!gr) + return FALSE; + ace->a_id = gr->gr_gid; + } if (ace->a_type & USER_OBJ) { ace->a_type &= ~USER_OBJ; @@ -194,28 +194,28 @@ getaclentries (action_t action, char *buf, aclent_t *acls, int *idx) char fbuf[256], *fb; if (!strcmp (buf, "-")) - fp = stdin; + fp = stdin; else if (! (fp = fopen (buf, "r"))) - return FALSE; + return FALSE; while ((fb = fgets (fbuf, 256, fp))) - { + { while (strchr (" \t", *fb)) ++fb; if (strchr ("\n\r#", *fb)) continue; - if (!getaclentry (action, fb, acls + (*idx)++)) - { - fclose (fp); - return FALSE; - } - } + if (!getaclentry (action, fb, acls + (*idx)++)) + { + fclose (fp); + return FALSE; + } + } if (fp != stdin) fclose (fp); } else for (c = strtok (buf, ","); c; c = strtok (NULL, ",")) if (!getaclentry (action, c, acls + (*idx)++)) - return FALSE; + return FALSE; return TRUE; } @@ -226,7 +226,7 @@ searchace (aclent_t *aclp, int nentries, int type, int id) for (i = 0; i < nentries; ++i) if ((aclp[i].a_type == type && (id < 0 || aclp[i].a_id == id)) - || !aclp[i].a_type) + || !aclp[i].a_type) return i; return -1; } @@ -239,24 +239,24 @@ modacl (aclent_t *tgt, int tcnt, aclent_t *src, int scnt) for (s = 0; s < scnt; ++s) { t = searchace (tgt, MAX_ACL_ENTRIES, src[s].a_type, - (src[s].a_type & (USER | GROUP)) ? src[s].a_id : -1); + (src[s].a_type & (USER | GROUP)) ? src[s].a_id : -1); if (t < 0) - return -1; + return -1; if (src[s].a_perm == ILLEGAL_MODE) - { - if (t < tcnt) - { - for (i = t + 1; i < tcnt; ++i) - tgt[i - 1] = tgt[i]; - --tcnt; - } - } + { + if (t < tcnt) + { + for (i = t + 1; i < tcnt; ++i) + tgt[i - 1] = tgt[i]; + --tcnt; + } + } else - { - tgt[t] = src[s]; - if (t >= tcnt) - ++tcnt; - } + { + tgt[t] = src[s]; + if (t >= tcnt) + ++tcnt; + } } return tcnt; } @@ -290,105 +290,105 @@ static void usage (FILE * stream) { fprintf (stream, "" - "Usage: %s [-r] (-f ACL_FILE | -s acl_entries) FILE...\n" - " %s [-r] ([-d acl_entries] [-m acl_entries]) FILE...\n" - "\n" - "Modify file and directory access control lists (ACLs)\n" - "\n" - " -d, --delete delete one or more specified ACL entries\n" - " -f, --file set ACL entries for FILE to ACL entries read\n" - " from a ACL_FILE\n" - " -m, --modify modify one or more specified ACL entries\n" - " -r, --replace replace mask entry with maximum permissions\n" - " needed for the file group class\n" - " -s, --substitute substitute specified ACL entries for the\n" - " ACL of FILE\n" - " -h, --help output usage information and exit\n" - " -V, --version output version information and exit\n" - "\n" - "At least one of (-d, -f, -m, -s) must be specified\n" - "\n", prog_name, prog_name); - if (stream == stdout) + "Usage: %s [-r] (-f ACL_FILE | -s acl_entries) FILE...\n" + " %s [-r] ([-d acl_entries] [-m acl_entries]) FILE...\n" + "\n" + "Modify file and directory access control lists (ACLs)\n" + "\n" + " -d, --delete delete one or more specified ACL entries\n" + " -f, --file set ACL entries for FILE to ACL entries read\n" + " from a ACL_FILE\n" + " -m, --modify modify one or more specified ACL entries\n" + " -r, --replace replace mask entry with maximum permissions\n" + " needed for the file group class\n" + " -s, --substitute substitute specified ACL entries for the\n" + " ACL of FILE\n" + " -h, --help output usage information and exit\n" + " -V, --version output version information and exit\n" + "\n" + "At least one of (-d, -f, -m, -s) must be specified\n" + "\n", prog_name, prog_name); + if (stream == stdout) { printf("" - " Acl_entries are one or more comma-separated ACL entries \n" - " from the following list:\n" - "\n" - " u[ser]::perm\n" - " u[ser]:uid:perm\n" - " g[roup]::perm\n" - " g[roup]:gid:perm\n" - " m[ask]:perm\n" - " o[ther]:perm\n" - "\n" - " Default entries are like the above with the additional\n" - " default identifier. For example: \n" - "\n" - " d[efault]:u[ser]:uid:perm\n" - "\n" - " 'perm' is either a 3-char permissions string in the form\n" - " \"rwx\" with the character - for no permission\n" - " or it is the octal representation of the permissions, a\n" - " value from 0 (equivalent to \"---\") to 7 (\"rwx\").\n" - " 'uid' is a user name or a numerical uid.\n" - " 'gid' is a group name or a numerical gid.\n" - "\n" - "\n" - "For each file given as parameter, %s will either replace its\n" - "complete ACL (-s, -f), or it will add, modify, or delete ACL\n" - "entries.\n" - "\n" - "The following options are supported:\n" - "\n" - "-d Delete one or more specified entries from the file's ACL.\n" - " The owner, group and others entries must not be deleted.\n" - " Acl_entries to be deleted should be specified without\n" - " permissions, as in the following list:\n" - "\n" - " u[ser]:uid\n" - " g[roup]:gid\n" - " d[efault]:u[ser]:uid\n" - " d[efault]:g[roup]:gid\n" - " d[efault]:m[ask]:\n" - " d[efault]:o[ther]:\n" - "\n" - "-f Take the Acl_entries from ACL_FILE one per line. Whitespace\n" - " characters are ignored, and the character \"#\" may be used\n" - " to start a comment. The special filename \"-\" indicates\n" - " reading from stdin.\n" - " Required entries are\n" - " - One user entry for the owner of the file.\n" - " - One group entry for the group of the file.\n" - " - One other entry.\n" - " If additional user and group entries are given:\n" - " - A mask entry for the file group class of the file.\n" - " - No duplicate user or group entries with the same uid/gid.\n" - " If it is a directory:\n" - " - One default user entry for the owner of the file.\n" - " - One default group entry for the group of the file.\n" - " - One default mask entry for the file group class.\n" - " - One default other entry.\n" - "\n" - "-m Add or modify one or more specified ACL entries.\n" - " Acl_entries is a comma-separated list of entries from the \n" - " same list as above.\n" - "\n" - "-r Causes the permissions specified in the mask entry to be\n" - " ignored and replaced by the maximum permissions needed for\n" - " the file group class.\n" - "\n" - "-s Like -f, but substitute the file's ACL with Acl_entries\n" - " specified in a comma-separated list on the command line.\n" - "\n" - "While the -d and -m options may be used in the same command, the\n" - "-f and -s options may be used only exclusively.\n" - "\n" - "Directories may contain default ACL entries. Files created\n" - "in a directory that contains default ACL entries will have\n" - "permissions according to the combination of the current umask,\n" - "the explicit permissions requested and the default ACL entries\n" - "Note: Under Cygwin, the default ACL entries are not taken into\n" - "account currently.\n\n", prog_name); + " Acl_entries are one or more comma-separated ACL entries \n" + " from the following list:\n" + "\n" + " u[ser]::perm\n" + " u[ser]:uid:perm\n" + " g[roup]::perm\n" + " g[roup]:gid:perm\n" + " m[ask]:perm\n" + " o[ther]:perm\n" + "\n" + " Default entries are like the above with the additional\n" + " default identifier. For example: \n" + "\n" + " d[efault]:u[ser]:uid:perm\n" + "\n" + " 'perm' is either a 3-char permissions string in the form\n" + " \"rwx\" with the character - for no permission\n" + " or it is the octal representation of the permissions, a\n" + " value from 0 (equivalent to \"---\") to 7 (\"rwx\").\n" + " 'uid' is a user name or a numerical uid.\n" + " 'gid' is a group name or a numerical gid.\n" + "\n" + "\n" + "For each file given as parameter, %s will either replace its\n" + "complete ACL (-s, -f), or it will add, modify, or delete ACL\n" + "entries.\n" + "\n" + "The following options are supported:\n" + "\n" + "-d Delete one or more specified entries from the file's ACL.\n" + " The owner, group and others entries must not be deleted.\n" + " Acl_entries to be deleted should be specified without\n" + " permissions, as in the following list:\n" + "\n" + " u[ser]:uid\n" + " g[roup]:gid\n" + " d[efault]:u[ser]:uid\n" + " d[efault]:g[roup]:gid\n" + " d[efault]:m[ask]:\n" + " d[efault]:o[ther]:\n" + "\n" + "-f Take the Acl_entries from ACL_FILE one per line. Whitespace\n" + " characters are ignored, and the character \"#\" may be used\n" + " to start a comment. The special filename \"-\" indicates\n" + " reading from stdin.\n" + " Required entries are\n" + " - One user entry for the owner of the file.\n" + " - One group entry for the group of the file.\n" + " - One other entry.\n" + " If additional user and group entries are given:\n" + " - A mask entry for the file group class of the file.\n" + " - No duplicate user or group entries with the same uid/gid.\n" + " If it is a directory:\n" + " - One default user entry for the owner of the file.\n" + " - One default group entry for the group of the file.\n" + " - One default mask entry for the file group class.\n" + " - One default other entry.\n" + "\n" + "-m Add or modify one or more specified ACL entries.\n" + " Acl_entries is a comma-separated list of entries from the \n" + " same list as above.\n" + "\n" + "-r Causes the permissions specified in the mask entry to be\n" + " ignored and replaced by the maximum permissions needed for\n" + " the file group class.\n" + "\n" + "-s Like -f, but substitute the file's ACL with Acl_entries\n" + " specified in a comma-separated list on the command line.\n" + "\n" + "While the -d and -m options may be used in the same command, the\n" + "-f and -s options may be used only exclusively.\n" + "\n" + "Directories may contain default ACL entries. Files created\n" + "in a directory that contains default ACL entries will have\n" + "permissions according to the combination of the current umask,\n" + "the explicit permissions requested and the default ACL entries\n" + "Note: Under Cygwin, the default ACL entries are not taken into\n" + "account currently.\n\n", prog_name); } else fprintf(stream, "Try '%s --help' for more information.\n", prog_name); @@ -410,14 +410,14 @@ static void print_version () { printf ("setfacl (cygwin) %d.%d.%d\n" - "POSIX ACL modification utility\n" - "Copyright (C) 2000 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "POSIX ACL modification utility\n" + "Copyright (C) 2000 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } int @@ -437,83 +437,83 @@ main (int argc, char **argv) switch (c) { case 'd': - if (action == NoAction) - action = Delete; - else if (action == Modify) - action = ModNDel; - else - { - usage (stderr); - return 1; + if (action == NoAction) + action = Delete; + else if (action == Modify) + action = ModNDel; + else + { + usage (stderr); + return 1; } - if (! getaclentries (Delete, optarg, acls, &aclidx)) - { - fprintf (stderr, "%s: illegal acl entries\n", prog_name); - return 2; - } - break; + if (! getaclentries (Delete, optarg, acls, &aclidx)) + { + fprintf (stderr, "%s: illegal acl entries\n", prog_name); + return 2; + } + break; case 'f': - if (action == NoAction) - action = Set; - else - { - usage (stderr); - return 1; + if (action == NoAction) + action = Set; + else + { + usage (stderr); + return 1; + } + if (! getaclentries (SetFromFile, optarg, acls, &aclidx)) + { + fprintf (stderr, "%s: illegal acl entries\n", prog_name); + return 2; } - if (! getaclentries (SetFromFile, optarg, acls, &aclidx)) - { - fprintf (stderr, "%s: illegal acl entries\n", prog_name); - return 2; - } - break; + break; case 'h': - usage (stdout); - return 0; + usage (stdout); + return 0; case 'm': - if (action == NoAction) - action = Modify; - else if (action == Delete) - action = ModNDel; - else - { - usage (stderr); - return 1; + if (action == NoAction) + action = Modify; + else if (action == Delete) + action = ModNDel; + else + { + usage (stderr); + return 1; } - if (! getaclentries (Modify, optarg, acls, &aclidx)) - { - fprintf (stderr, "%s: illegal acl entries\n", prog_name); - return 2; - } - break; + if (! getaclentries (Modify, optarg, acls, &aclidx)) + { + fprintf (stderr, "%s: illegal acl entries\n", prog_name); + return 2; + } + break; case 'r': - if (!ropt) - ropt = 1; - else - { - usage (stderr); - return 1; + if (!ropt) + ropt = 1; + else + { + usage (stderr); + return 1; } - break; + break; case 's': - if (action == NoAction) - action = Set; - else - { - usage (stderr); - return 1; + if (action == NoAction) + action = Set; + else + { + usage (stderr); + return 1; + } + if (! getaclentries (Set, optarg, acls, &aclidx)) + { + fprintf (stderr, "%s: illegal acl entries\n", prog_name); + return 2; } - if (! getaclentries (Set, optarg, acls, &aclidx)) - { - fprintf (stderr, "%s: illegal acl entries\n", prog_name); - return 2; - } - break; + break; case 'V': - print_version (); - return 0; + print_version (); + return 0; default: - fprintf (stderr, "Try `%s --help' for more information.\n", prog_name); - return 1; + fprintf (stderr, "Try `%s --help' for more information.\n", prog_name); + return 1; } if (action == NoAction) { @@ -529,31 +529,31 @@ main (int argc, char **argv) switch (aclcheck (acls, aclidx, NULL)) { case GRP_ERROR: - fprintf (stderr, "%s: more than one group entry.\n", prog_name); - return 2; + fprintf (stderr, "%s: more than one group entry.\n", prog_name); + return 2; case USER_ERROR: - fprintf (stderr, "%s: more than one user entry.\n", prog_name); - return 2; + fprintf (stderr, "%s: more than one user entry.\n", prog_name); + return 2; case CLASS_ERROR: - fprintf (stderr, "%s: more than one mask entry.\n", prog_name); - return 2; + fprintf (stderr, "%s: more than one mask entry.\n", prog_name); + return 2; case OTHER_ERROR: - fprintf (stderr, "%s: more than one other entry.\n", prog_name); - return 2; + fprintf (stderr, "%s: more than one other entry.\n", prog_name); + return 2; case DUPLICATE_ERROR: - fprintf (stderr, "%s: duplicate additional user or group.\n", prog_name); - return 2; + fprintf (stderr, "%s: duplicate additional user or group.\n", prog_name); + return 2; case ENTRY_ERROR: - fprintf (stderr, "%s: invalid entry type.\n", prog_name); - return 2; + fprintf (stderr, "%s: invalid entry type.\n", prog_name); + return 2; case MISS_ERROR: - fprintf (stderr, "%s: missing entries.\n", prog_name); - return 2; + fprintf (stderr, "%s: missing entries.\n", prog_name); + return 2; case MEM_ERROR: - fprintf (stderr, "%s: out of memory.\n", prog_name); - return 2; + fprintf (stderr, "%s: out of memory.\n", prog_name); + return 2; default: - break; + break; } for (c = optind; c < argc; ++c) ret |= setfacl (action, argv[c], acls, aclidx); diff --git a/winsup/utils/setmetamode.c b/winsup/utils/setmetamode.c index de8c45544..fc1059f7c 100644 --- a/winsup/utils/setmetamode.c +++ b/winsup/utils/setmetamode.c @@ -48,14 +48,14 @@ void print_version () { printf ("setmetamode (cygwin) %d.%d.%d\n" - "Get or set keyboard meta mode\n" - "Copyright (C) 2006 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Get or set keyboard meta mode\n" + "Copyright (C) 2006 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } struct option longopts[] = { @@ -89,7 +89,7 @@ main (int ac, char *av[]) switch (opt) { case 'h': - usage (); + usage (); return 0; case 'V': print_version (); diff --git a/winsup/utils/ssp.c b/winsup/utils/ssp.c index 662c0847d..63aa9197e 100644 --- a/winsup/utils/ssp.c +++ b/winsup/utils/ssp.c @@ -662,7 +662,7 @@ usage (FILE * stream) " -h, --help output usage information and exit\n" " -l, --dll enable dll profiling. A chart of relative DLL usage\n" " is produced after the run.\n" - " -s, --sub-threads trace sub-threads too. Dangerous if you have\n" + " -s, --sub-threads trace sub-threads too. Dangerous if you have\n" " race conditions.\n" " -t, --trace-eip trace every EIP value to a file TRACE.SSP. This\n" " gets big *fast*.\n" @@ -813,14 +813,14 @@ static void print_version () { printf ("ssp (cygwin) %d.%d.%d\n" - "Single-Step Profiler\n" - "Copyright (C) 2000 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Single-Step Profiler\n" + "Copyright (C) 2000 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } int @@ -838,48 +838,48 @@ main (int argc, char **argv) switch (c) { case 'c': - printf ("tracing *all* $eip to the console\n"); - trace_console = 1; - break; + printf ("tracing *all* $eip to the console\n"); + trace_console = 1; + break; case 'd': - printf ("stepping disabled; enable via OutputDebugString (\"ssp on\")\n"); - stepping_enabled = 0; - break; + printf ("stepping disabled; enable via OutputDebugString (\"ssp on\")\n"); + stepping_enabled = 0; + break; case 'e': - printf ("stepping enabled; disable via OutputDebugString (\"ssp off\")\n"); - stepping_enabled = 1; - break; + printf ("stepping enabled; disable via OutputDebugString (\"ssp off\")\n"); + stepping_enabled = 1; + break; case 'h': - usage (stdout); - break; + usage (stdout); + break; case 'l': - printf ("profiling dll usage\n"); - dll_counts = 1; - break; + printf ("profiling dll usage\n"); + dll_counts = 1; + break; case 's': - printf ("tracing all sub-threads too, not just the main one\n"); - trace_all_threads = 1; - break; + printf ("tracing all sub-threads too, not just the main one\n"); + trace_all_threads = 1; + break; case 't': - printf ("tracing all $eip to trace.ssp\n"); - tracing_enabled = 1; - break; + printf ("tracing all $eip to trace.ssp\n"); + tracing_enabled = 1; + break; case 'v': - printf ("verbose messages enabled\n"); - verbose = 1; - break; + printf ("verbose messages enabled\n"); + verbose = 1; + break; case 'V': - print_version (); - exit (0); - default: - fprintf (stderr, "Try `%s --help' for more information.\n", prog_name); + print_version (); + exit (0); + default: + fprintf (stderr, "Try `%s --help' for more information.\n", prog_name); exit (1); } if ( (argc - optind) < 3 ) usage (stderr); - sscanf (argv[optind++], "%i", &low_pc); - sscanf (argv[optind++], "%i", &high_pc); + sscanf (argv[optind++], "%i", &low_pc); + sscanf (argv[optind++], "%i", &high_pc); if (low_pc > high_pc-8) { diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index c84fede85..42fb955be 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -310,16 +310,16 @@ attach_process (pid_t pid) HANDLE h = OpenProcess(PROCESS_ALL_ACCESS, FALSE, child_pid); if (h) - { - /* Try to turn off DEBUG_ONLY_THIS_PROCESS so we can follow forks */ - /* This is only supported on XP and later */ - ULONG DebugFlags = DEBUG_PROCESS_DETACH_ON_EXIT; - NTSTATUS status = NtSetInformationProcess (h, ProcessDebugFlags, &DebugFlags, sizeof (DebugFlags)); - if (!NT_SUCCESS (status)) - warn (0, "Could not clear DEBUG_ONLY_THIS_PROCESS (%x), will not trace child processes", status); - - CloseHandle(h); - } + { + /* Try to turn off DEBUG_ONLY_THIS_PROCESS so we can follow forks */ + /* This is only supported on XP and later */ + ULONG DebugFlags = DEBUG_PROCESS_DETACH_ON_EXIT; + NTSTATUS status = NtSetInformationProcess (h, ProcessDebugFlags, &DebugFlags, sizeof (DebugFlags)); + if (!NT_SUCCESS (status)) + warn (0, "Could not clear DEBUG_ONLY_THIS_PROCESS (%x), will not trace child processes", status); + + CloseHandle(h); + } } return; @@ -866,15 +866,15 @@ Trace system calls and signals\n\ -h, --help output usage information and exit\n\ -m, --mask=MASK set message filter mask\n\ -n, --crack-error-numbers output descriptive text instead of error\n\ - numbers for Windows errors\n\ + numbers for Windows errors\n\ -o, --output=FILENAME set output file to FILENAME\n\ -p, --pid=n attach to executing program with cygwin pid n\n\ -q, --quiet suppress messages about attaching, detaching, etc.\n\ -S, --flush-period=PERIOD flush buffered strace output every PERIOD secs\n\ -t, --timestamp use an absolute hh:mm:ss timestamp insted of \n\ - the default microsecond timestamp. Implies -d\n\ + the default microsecond timestamp. Implies -d\n\ -T, --toggle toggle tracing in a process already being\n\ - traced. Requires -p \n\ + traced. Requires -p \n\ -u, --usecs toggle printing of microseconds timestamp\n\ -V, --version output version information and exit\n\ -w, --new-window spawn program under test in a new window\n\ @@ -884,7 +884,7 @@ Trace system calls and signals\n\ MASK can be any combination of the following mnemonics and/or hex values\n\ (0x is optional). Combine masks with '+' or ',' like so:\n\ \n\ - --mask=wm+system,malloc+0x00800\n\ + --mask=wm+system,malloc+0x00800\n\ \n\ Mnemonic Hex Corresponding Def Description\n\ =========================================================================\n\ @@ -908,7 +908,7 @@ Trace system calls and signals\n\ malloc 0x020000 (_STRACE_MALLOC) Trace malloc calls.\n\ thread 0x040000 (_STRACE_THREAD) Thread-locking calls.\n\ special 0x100000 (_STRACE_SPECIAL) Special debugging printfs for\n\ - non-checked-in code\n\ + non-checked-in code\n\ "); if (where == stderr) fprintf (stderr, "Try `%s --help' for more information.\n", pgm); @@ -941,14 +941,14 @@ static void print_version () { printf ("strace (cygwin) %d.%d.%d\n" - "System Trace\n" - "Copyright (C) 2000 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "System Trace\n" + "Copyright (C) 2000 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } int diff --git a/winsup/utils/testsuite.cc b/winsup/utils/testsuite.cc index b87f85cf8..b6762052c 100644 --- a/winsup/utils/testsuite.cc +++ b/winsup/utils/testsuite.cc @@ -66,24 +66,24 @@ main (int argc, char **argv) { char *result = cygpath (t.posix, NULL); bool pass = (strcmp (result, t.win32) == 0); - + if (pass) - { - numpass++; - printf ("test %03d: PASS cwd=%-18s input=%-22s expected+actual=%s\n", - curtest, t.cwd, t.posix, result); - } + { + numpass++; + printf ("test %03d: PASS cwd=%-18s input=%-22s expected+actual=%s\n", + curtest, t.cwd, t.posix, result); + } else - { - printf ("test %03d: FAIL cwd=%-18s input=%-29s expected=%-25s actual=%s\n", - curtest, t.cwd, t.posix, t.win32, result); - } + { + printf ("test %03d: FAIL cwd=%-18s input=%-29s expected=%-25s actual=%s\n", + curtest, t.cwd, t.posix, t.win32, result); + } } printf ("\n" - "total tests: %d\n" - "pass : %d (%.1f%%)\n" - "fail : %d (%.1f%%)\n", - curtest, numpass, ((float)numpass)/curtest * 100.0F, curtest - numpass, - ((float)curtest - numpass)/curtest * 100.0F); + "total tests: %d\n" + "pass : %d (%.1f%%)\n" + "fail : %d (%.1f%%)\n", + curtest, numpass, ((float)numpass)/curtest * 100.0F, curtest - numpass, + ((float)curtest - numpass)/curtest * 100.0F); return (numpass < curtest ? 1 : 0); } diff --git a/winsup/utils/testsuite.h b/winsup/utils/testsuite.h index 3bc360ab5..a75d6d1e1 100644 --- a/winsup/utils/testsuite.h +++ b/winsup/utils/testsuite.h @@ -60,11 +60,11 @@ static test_t testsuite_tests[] = { { NO_CWD, "/usr/bin/dir/file.ext", TESTSUITE_ROOT"\\bin\\dir\\file.ext" }, { NO_CWD, "/usr/lib/file.ext", TESTSUITE_ROOT"\\lib\\file.ext" }, { NO_CWD, "/usr/lib/dir/file.ext", TESTSUITE_ROOT"\\lib\\dir\\file.ext" }, - { NO_CWD, "/home/file.ext", TESTSUITE_ROOT"\\home\\file.ext" }, - { NO_CWD, "/home/foo/file.ext", TESTSUITE_ROOT"\\home\\foo\\file.ext" }, - { NO_CWD, "/home/foo/dir/file.ext", TESTSUITE_ROOT"\\home\\foo\\dir\\file.ext" }, - { NO_CWD, "/usr/file.ext", TESTSUITE_ROOT"\\usr\\file.ext" }, - { NO_CWD, "/usr/share/file.ext", TESTSUITE_ROOT"\\usr\\share\\file.ext" }, + { NO_CWD, "/home/file.ext", TESTSUITE_ROOT"\\home\\file.ext" }, + { NO_CWD, "/home/foo/file.ext", TESTSUITE_ROOT"\\home\\foo\\file.ext" }, + { NO_CWD, "/home/foo/dir/file.ext", TESTSUITE_ROOT"\\home\\foo\\dir\\file.ext" }, + { NO_CWD, "/usr/file.ext", TESTSUITE_ROOT"\\usr\\file.ext" }, + { NO_CWD, "/usr/share/file.ext", TESTSUITE_ROOT"\\usr\\share\\file.ext" }, { TESTSUITE_ROOT, "foo", TESTSUITE_ROOT"\\foo" }, { TESTSUITE_ROOT, "./foo", TESTSUITE_ROOT"\\foo" }, { TESTSUITE_ROOT, "foo/bar", TESTSUITE_ROOT"\\foo\\bar" }, diff --git a/winsup/utils/umount.cc b/winsup/utils/umount.cc index de27ff335..82730530b 100644 --- a/winsup/utils/umount.cc +++ b/winsup/utils/umount.cc @@ -57,14 +57,14 @@ static void print_version () { printf ("umount (cygwin) %d.%d.%d\n" - "Unmount filesystem utility\n" - "Copyright (C) 1996 - %s Red Hat, Inc.\n" - "This is free software; see the source for copying conditions. There is NO\n" + "Unmount filesystem utility\n" + "Copyright (C) 1996 - %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.\n", - CYGWIN_VERSION_DLL_MAJOR / 1000, - CYGWIN_VERSION_DLL_MAJOR % 1000, - CYGWIN_VERSION_DLL_MINOR, - strrchr (__DATE__, ' ') + 1); + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } int diff --git a/winsup/utils/wide_path.h b/winsup/utils/wide_path.h index 8c49c5bf8..3194ecf97 100644 --- a/winsup/utils/wide_path.h +++ b/winsup/utils/wide_path.h @@ -1,5 +1,5 @@ /* wide_path.h -- Define class wide_path to convert multibyte win32 path - to wchar_t Win32 path including long path prefix if + to wchar_t Win32 path including long path prefix if necessary. Copyright 2009 Red Hat, Inc. -- cgit v1.2.3