fix whitespace, update some copyrights

This commit is contained in:
Christopher Faylor 2004-10-25 15:49:36 +00:00
parent bc4ab99276
commit 4bfc614b42
8 changed files with 87 additions and 87 deletions

View File

@ -8,7 +8,7 @@
* cygcheck.cc (dump_sysinfo): Allow for larger drives in drive-list. * cygcheck.cc (dump_sysinfo): Allow for larger drives in drive-list.
Change ``Used'' to ``Free'' in helptext-title for drive-list. Change ``Used'' to ``Free'' in helptext-title for drive-list.
2004-10-18 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> 2004-10-18 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl>
* cygcheck.cc (pretty_id): Don't let i become negative. Fix * cygcheck.cc (pretty_id): Don't let i become negative. Fix
printf-format. printf-format.

View File

@ -1083,9 +1083,9 @@ dump_sysinfo ()
DWORD serno = 0, maxnamelen = 0, flags = 0; DWORD serno = 0, maxnamelen = 0, flags = 0;
name[0] = name[0] = fsname[0] = 0; name[0] = name[0] = fsname[0] = 0;
sprintf (drive, "%c:\\", i + 'a'); sprintf (drive, "%c:\\", i + 'a');
/* Report all errors, except if the Volume is ERROR_NOT_READY. /* Report all errors, except if the Volume is ERROR_NOT_READY.
ERROR_NOT_READY is returned when removeable media drives are empty ERROR_NOT_READY is returned when removeable media drives are empty
(CD, floppy, etc.) */ (CD, floppy, etc.) */
if (!GetVolumeInformation if (!GetVolumeInformation
(drive, name, sizeof (name), &serno, &maxnamelen, &flags, fsname, (drive, name, sizeof (name), &serno, &maxnamelen, &flags, fsname,
sizeof (fsname)) && GetLastError () != ERROR_NOT_READY) sizeof (fsname)) && GetLastError () != ERROR_NOT_READY)

View File

@ -191,17 +191,17 @@ could_not_access (int verbose, char *filename, char *package, const char *type)
switch (errno) switch (errno)
{ {
case ENOTDIR: case ENOTDIR:
break; break;
case ENOENT: case ENOENT:
if (verbose) if (verbose)
printf ("Missing %s: /%s from package %s\n", printf ("Missing %s: /%s from package %s\n",
type, filename, package); type, filename, package);
return true; return true;
case EACCES: case EACCES:
if (verbose) if (verbose)
printf ("Unable to access %s /%s from package %s\n", printf ("Unable to access %s /%s from package %s\n",
type, filename, package); type, filename, package);
return true; return true;
} }
return false; return false;
} }
@ -213,12 +213,12 @@ directory_exists (int verbose, char *filename, char *package)
if (stat(cygpath("/", filename, ".", NULL), &status)) if (stat(cygpath("/", filename, ".", NULL), &status))
{ {
if (could_not_access (verbose, filename, package, "directory")) if (could_not_access (verbose, filename, package, "directory"))
return false; return false;
} }
else if (!S_ISDIR(status.st_mode)) else if (!S_ISDIR(status.st_mode))
{ {
if (verbose) if (verbose)
printf ("Directory/file mismatch: /%s from package %s\n", filename, package); printf ("Directory/file mismatch: /%s from package %s\n", filename, package);
return false; return false;
} }
return true; return true;
@ -232,12 +232,12 @@ file_exists (int verbose, char *filename, const char *alt, char *package)
(!alt || stat(cygpath("/", filename, alt, NULL), &status))) (!alt || stat(cygpath("/", filename, alt, NULL), &status)))
{ {
if (could_not_access (verbose, filename, package, "file")) if (could_not_access (verbose, filename, package, "file"))
return false; return false;
} }
else if (!S_ISREG(status.st_mode)) else if (!S_ISREG(status.st_mode))
{ {
if (verbose) if (verbose)
printf ("File type mismatch: /%s from package %s\n", filename, package); printf ("File type mismatch: /%s from package %s\n", filename, package);
return false; return false;
} }
return true; return true;
@ -286,20 +286,20 @@ check_package_files (int verbose, char *package)
filename += 2; filename += 2;
if (filename[strlen (filename) - 1] == '/') if (filename[strlen (filename) - 1] == '/')
{ {
if (!directory_exists (verbose, filename, package)) if (!directory_exists (verbose, filename, package))
result = false; result = false;
} }
else if (!strncmp (filename, "etc/postinstall/", 16)) else if (!strncmp (filename, "etc/postinstall/", 16))
{ {
if (!file_exists (verbose, filename, ".done", package)) if (!file_exists (verbose, filename, ".done", package))
result = false; result = false;
} }
else else
{ {
if (!file_exists (verbose, filename, ".lnk", package)) if (!file_exists (verbose, filename, ".lnk", package))
result = false; result = false;
} }
} }
gzclose (fp); gzclose (fp);

View File

@ -411,8 +411,8 @@ dumper::dump_thread (asection * to, process_thread * thread)
if (tid == 0) if (tid == 0)
{ {
/* this is a special case. we don't know, which thread /* this is a special case. we don't know, which thread
was active when exception occured, so let's blame was active when exception occured, so let's blame
the first one */ the first one */
thread_pstatus.data.thread_info.is_active_thread = TRUE; thread_pstatus.data.thread_info.is_active_thread = TRUE;
tid = (DWORD) - 1; tid = (DWORD) - 1;
} }
@ -795,7 +795,7 @@ struct option longopts[] = {
{0, no_argument, NULL, 0} {0, no_argument, NULL, 0}
}; };
static void static void
print_version () print_version ()
{ {
const char *v = strchr (version, ':'); const char *v = strchr (version, ':');

View File

@ -92,7 +92,7 @@ do_mount (const char *dev, const char *where, int flags)
if (c == '/' || c == '\\') if (c == '/' || c == '\\')
strcat (devtmp, "."); strcat (devtmp, ".");
/* Use a curious property of Windows which allows the use of \.. even /* Use a curious property of Windows which allows the use of \.. even
on non-directory paths. */ on non-directory paths. */
for (const char *p = dev; (p = strpbrk (p, "/\\")); p++) for (const char *p = dev; (p = strpbrk (p, "/\\")); p++)
strcat (devtmp, "\\.."); strcat (devtmp, "\\..");
strcat (devtmp, "\\"); strcat (devtmp, "\\");

View File

@ -30,7 +30,7 @@ exclusion::add (LPBYTE mem_base, DWORD mem_size)
return 1; return 1;
}; };
int int
cmp_regions (const void *r1, const void *r2) cmp_regions (const void *r1, const void *r2)
{ {
if (((process_mem_region *) r1)->base < ((process_mem_region *) r2)->base) if (((process_mem_region *) r1)->base < ((process_mem_region *) r2)->base)

View File

@ -1,6 +1,6 @@
/* ps.cc /* ps.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -271,45 +271,45 @@ main (int argc, char *argv[])
{ {
case 'a': case 'a':
case 'e': case 'e':
aflag = 1; aflag = 1;
break; break;
case 'f': case 'f':
fflag = 1; fflag = 1;
break; break;
case 'h': case 'h':
usage (stdout, 0); usage (stdout, 0);
case 'l': case 'l':
lflag = 1; lflag = 1;
break; break;
case 's': case 's':
sflag = 1; sflag = 1;
break; break;
case 'u': case 'u':
uid = atoi (optarg); uid = atoi (optarg);
if (uid == 0) if (uid == 0)
{ {
struct passwd *pw; struct passwd *pw;
if ((pw = getpwnam (optarg))) if ((pw = getpwnam (optarg)))
uid = pw->pw_uid; uid = pw->pw_uid;
else else
{ {
fprintf (stderr, "%s: user %s unknown\n", prog_name, optarg); fprintf (stderr, "%s: user %s unknown\n", prog_name, optarg);
exit (1); exit (1);
} }
} }
break; break;
case 'v': case 'v':
print_version (); print_version ();
exit (0); exit (0);
break; break;
case 'W': case 'W':
query = CW_GETPINFO_FULL; query = CW_GETPINFO_FULL;
aflag = 1; aflag = 1;
break; break;
default: default:
usage (stderr, 1); usage (stderr, 1);
} }
if (sflag) if (sflag)
@ -329,24 +329,24 @@ main (int argc, char *argv[])
pid = p->pid) pid = p->pid)
{ {
if (!aflag) if (!aflag)
if (p->version >= EXTERNAL_PINFO_VERSION_32_BIT) if (p->version >= EXTERNAL_PINFO_VERSION_32_BIT)
{ {
if (p->uid32 != (__uid32_t) uid) if (p->uid32 != (__uid32_t) uid)
continue; continue;
} }
else if (p->uid != uid) else if (p->uid != uid)
continue; continue;
char status = ' '; char status = ' ';
if (p->process_state & PID_STOPPED) if (p->process_state & PID_STOPPED)
status = 'S'; status = 'S';
else if (p->process_state & PID_TTYIN) else if (p->process_state & PID_TTYIN)
status = 'I'; status = 'I';
else if (p->process_state & PID_TTYOU) else if (p->process_state & PID_TTYOU)
status = 'O'; status = 'O';
char pname[MAX_PATH]; char pname[MAX_PATH];
if (p->process_state & (PID_ZOMBIE | PID_EXITED)) if (p->process_state & (PID_ZOMBIE | PID_EXITED))
strcpy (pname, "<defunct>"); strcpy (pname, "<defunct>");
else if (p->ppid) else if (p->ppid)
{ {
char *s; char *s;
@ -359,7 +359,7 @@ main (int argc, char *argv[])
else if (query == CW_GETPINFO_FULL) else if (query == CW_GETPINFO_FULL)
{ {
HANDLE h = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, HANDLE h = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
FALSE, p->dwProcessId); FALSE, p->dwProcessId);
if (!h) if (!h)
continue; continue;
HMODULE hm[1000]; HMODULE hm[1000];
@ -377,26 +377,26 @@ main (int argc, char *argv[])
char uname[128]; char uname[128];
if (fflag) if (fflag)
{ {
struct passwd *pw; struct passwd *pw;
if ((pw = getpwuid (p->version >= EXTERNAL_PINFO_VERSION_32_BIT ? if ((pw = getpwuid (p->version >= EXTERNAL_PINFO_VERSION_32_BIT ?
p->uid32 : p->uid))) p->uid32 : p->uid)))
strcpy (uname, pw->pw_name); strcpy (uname, pw->pw_name);
else else
sprintf (uname, "%u", (unsigned) sprintf (uname, "%u", (unsigned)
(p->version >= EXTERNAL_PINFO_VERSION_32_BIT ? (p->version >= EXTERNAL_PINFO_VERSION_32_BIT ?
p->uid32 : p->uid)); p->uid32 : p->uid));
} }
if (sflag) if (sflag)
printf (dfmt, p->pid, ttynam (p->ctty), start_time (p), pname); printf (dfmt, p->pid, ttynam (p->ctty), start_time (p), pname);
else if (fflag) else if (fflag)
printf (ffmt, uname, p->pid, p->ppid, ttynam (p->ctty), start_time (p), printf (ffmt, uname, p->pid, p->ppid, ttynam (p->ctty), start_time (p),
pname); pname);
else if (lflag) else if (lflag)
printf (lfmt, status, p->pid, p->ppid, p->pgid, printf (lfmt, status, p->pid, p->ppid, p->pgid,
p->dwProcessId, ttynam (p->ctty), p->dwProcessId, ttynam (p->ctty),
p->version >= EXTERNAL_PINFO_VERSION_32_BIT ? p->uid32 : p->uid, p->version >= EXTERNAL_PINFO_VERSION_32_BIT ? p->uid32 : p->uid,
start_time (p), pname); start_time (p), pname);

View File

@ -1,6 +1,6 @@
/* regtool.cc /* regtool.cc
Copyright 2000, 2001, 2002 Red Hat Inc. Copyright 2000, 2001, 2002, 2003, 2004 Red Hat Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -278,21 +278,21 @@ find_key (int howmanyparts, REGSAM access)
{ {
/* expect host:/key/value format */ /* expect host:/key/value format */
host = (char*) malloc (strlen (n) + 1); host = (char*) malloc (strlen (n) + 1);
host[0] = host [1] = '\\'; host[0] = host [1] = '\\';
for (e = n, h = host + 2; *e && *e != ':'; e++, h++) for (e = n, h = host + 2; *e && *e != ':'; e++, h++)
*h = *e; *h = *e;
*h = 0; *h = 0;
n = e + 1; n = e + 1;
if (*n == '/') if (*n == '/')
translate (n); translate (n);
} }
else if (n[0] == '\\' && n[1] == '\\') else if (n[0] == '\\' && n[1] == '\\')
{ {
/* expect //host/key/value format */ /* expect //host/key/value format */
host = (char*) malloc (strlen (n) + 1); host = (char*) malloc (strlen (n) + 1);
host[0] = host[1] = '\\'; host[0] = host[1] = '\\';
for (e = n + 2, h = host + 2; *e && *e != '\\'; e++, h++) for (e = n + 2, h = host + 2; *e && *e != '\\'; e++, h++)
*h = *e; *h = *e;
*h = 0; *h = 0;
n = e; n = e;
} }
@ -329,7 +329,7 @@ find_key (int howmanyparts, REGSAM access)
return; return;
} }
else else
{ {
*e = 0; *e = 0;
value = e + 1; value = e + 1;
} }