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.
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
printf-format.

View File

@ -1083,9 +1083,9 @@ dump_sysinfo ()
DWORD serno = 0, maxnamelen = 0, flags = 0;
name[0] = name[0] = fsname[0] = 0;
sprintf (drive, "%c:\\", i + 'a');
/* Report all errors, except if the Volume is ERROR_NOT_READY.
ERROR_NOT_READY is returned when removeable media drives are empty
(CD, floppy, etc.) */
/* Report all errors, except if the Volume is ERROR_NOT_READY.
ERROR_NOT_READY is returned when removeable media drives are empty
(CD, floppy, etc.) */
if (!GetVolumeInformation
(drive, name, sizeof (name), &serno, &maxnamelen, &flags, fsname,
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)
{
case ENOTDIR:
break;
break;
case ENOENT:
if (verbose)
printf ("Missing %s: /%s from package %s\n",
type, filename, package);
return true;
if (verbose)
printf ("Missing %s: /%s from package %s\n",
type, filename, package);
return true;
case EACCES:
if (verbose)
printf ("Unable to access %s /%s from package %s\n",
type, filename, package);
return true;
if (verbose)
printf ("Unable to access %s /%s from package %s\n",
type, filename, package);
return true;
}
return false;
}
@ -213,12 +213,12 @@ directory_exists (int verbose, char *filename, char *package)
if (stat(cygpath("/", filename, ".", NULL), &status))
{
if (could_not_access (verbose, filename, package, "directory"))
return false;
return false;
}
else if (!S_ISDIR(status.st_mode))
{
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 true;
@ -232,12 +232,12 @@ file_exists (int verbose, char *filename, const char *alt, char *package)
(!alt || stat(cygpath("/", filename, alt, NULL), &status)))
{
if (could_not_access (verbose, filename, package, "file"))
return false;
return false;
}
else if (!S_ISREG(status.st_mode))
{
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 true;
@ -286,20 +286,20 @@ check_package_files (int verbose, char *package)
filename += 2;
if (filename[strlen (filename) - 1] == '/')
{
if (!directory_exists (verbose, filename, package))
result = false;
}
{
if (!directory_exists (verbose, filename, package))
result = false;
}
else if (!strncmp (filename, "etc/postinstall/", 16))
{
if (!file_exists (verbose, filename, ".done", package))
result = false;
}
{
if (!file_exists (verbose, filename, ".done", package))
result = false;
}
else
{
if (!file_exists (verbose, filename, ".lnk", package))
result = false;
}
{
if (!file_exists (verbose, filename, ".lnk", package))
result = false;
}
}
gzclose (fp);

View File

@ -411,8 +411,8 @@ dumper::dump_thread (asection * to, process_thread * thread)
if (tid == 0)
{
/* this is a special case. we don't know, which thread
was active when exception occured, so let's blame
the first one */
was active when exception occured, so let's blame
the first one */
thread_pstatus.data.thread_info.is_active_thread = TRUE;
tid = (DWORD) - 1;
}
@ -795,7 +795,7 @@ struct option longopts[] = {
{0, no_argument, NULL, 0}
};
static void
static void
print_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 == '\\')
strcat (devtmp, ".");
/* 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++)
strcat (devtmp, "\\..");
strcat (devtmp, "\\");

View File

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

View File

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

View File

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