whitespace

This commit is contained in:
Christopher Faylor 2002-09-30 15:17:44 +00:00
parent 66dca8bb0d
commit 6cae97d5dc
9 changed files with 39 additions and 39 deletions

View File

@ -48,8 +48,8 @@ private:
attach_t (class process *const client)
: _client (client),
_refcnt (0),
_next (NULL)
_refcnt (0),
_next (NULL)
{}
};

View File

@ -48,8 +48,8 @@ private:
attach_t (class process *const client)
: _client (client),
_refcnt (0),
_next (NULL)
_refcnt (0),
_next (NULL)
{}
};

View File

@ -451,7 +451,7 @@ child_info NO_COPY *child_proc_info = NULL;
static MEMORY_BASIC_INFORMATION NO_COPY sm;
#define CYGWIN_GUARD ((wincap.has_page_guard ()) ? \
PAGE_EXECUTE_READWRITE|PAGE_GUARD : PAGE_NOACCESS)
PAGE_EXECUTE_READWRITE|PAGE_GUARD : PAGE_NOACCESS)
// __inline__ void
extern void

View File

@ -425,7 +425,7 @@ format_proc_uptime (char *destbuf, size_t maxsize)
{
idle_time = spt.IdleTime.QuadPart / 100000ULL;
uptime = (spt.KernelTime.QuadPart +
spt.UserTime.QuadPart) / 100000ULL;
spt.UserTime.QuadPart) / 100000ULL;
}
return __small_sprintf (destbuf, "%U.%02u %U.%02u\n",

View File

@ -48,7 +48,7 @@ fhandler_dev_random* entropy_source;
/* cygwin internal: map sockaddr into internet domain address */
static int
get_inet_addr (const struct sockaddr *in, int inlen,
struct sockaddr_in *out, int *outlen, int* secret = 0)
struct sockaddr_in *out, int *outlen, int* secret = 0)
{
int secret_buf [4];
int* secret_ptr = (secret ? : secret_buf);
@ -63,24 +63,24 @@ get_inet_addr (const struct sockaddr *in, int inlen,
{
int fd = _open (in->sa_data, O_RDONLY);
if (fd == -1)
return 0;
return 0;
int ret = 0;
char buf[128];
memset (buf, 0, sizeof buf);
if (read (fd, buf, sizeof buf) != -1)
{
sockaddr_in sin;
sin.sin_family = AF_INET;
sscanf (buf + strlen (SOCKET_COOKIE), "%hu %08x-%08x-%08x-%08x",
&sin.sin_port,
secret_ptr, secret_ptr + 1, secret_ptr + 2, secret_ptr + 3);
sin.sin_port = htons (sin.sin_port);
sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
*out = sin;
*outlen = sizeof sin;
ret = 1;
}
{
sockaddr_in sin;
sin.sin_family = AF_INET;
sscanf (buf + strlen (SOCKET_COOKIE), "%hu %08x-%08x-%08x-%08x",
&sin.sin_port,
secret_ptr, secret_ptr + 1, secret_ptr + 2, secret_ptr + 3);
sin.sin_port = htons (sin.sin_port);
sin.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
*out = sin;
*outlen = sizeof sin;
ret = 1;
}
_close (fd);
return ret;
}
@ -507,12 +507,12 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
ev[0] = WSACreateEvent ();
if (ev[0] != WSA_INVALID_EVENT &&
!WSAEventSelect (get_socket (), ev[0], FD_ACCEPT))
{
WSANETWORKEVENTS sock_event;
int wait_result;
!WSAEventSelect (get_socket (), ev[0], FD_ACCEPT))
{
WSANETWORKEVENTS sock_event;
int wait_result;
wait_result = WSAWaitForMultipleEvents (2, ev, FALSE, WSA_INFINITE,
wait_result = WSAWaitForMultipleEvents (2, ev, FALSE, WSA_INFINITE,
FALSE);
if (wait_result == WSA_WAIT_EVENT_0)
WSAEnumNetworkEvents (get_socket (), ev[0], &sock_event);

View File

@ -178,12 +178,12 @@ read_etc_group ()
DWORD siz;
if (OpenProcessToken (hMainProc, TOKEN_QUERY, &ptok))
{
{
if (GetTokenInformation (ptok, TokenPrimaryGroup, &tg,
sizeof tg, &siz)
&& LookupAccountSidA (NULL, tg, group_name,
&group_name_len, domain_name,
&domain_name_len, &acType))
&domain_name_len, &acType))
{
char strbuf[100];
snprintf (linebuf, sizeof (linebuf), "%s:%s:%lu:",

View File

@ -169,9 +169,9 @@ read_etc_passwd ()
DWORD siz;
if (OpenProcessToken (hMainProc, TOKEN_QUERY, &ptok))
{
{
if (GetTokenInformation (ptok, TokenUser, &tu, sizeof tu,
&siz)
&siz)
&& GetTokenInformation (ptok, TokenPrimaryGroup, &tg,
sizeof tg, &siz))
{
@ -180,16 +180,16 @@ read_etc_passwd ()
"%s::%lu:%lu:%s:%s:/bin/sh",
cygheap->user.name (),
*GetSidSubAuthority (tu,
*GetSidSubAuthorityCount(tu) - 1),
*GetSidSubAuthorityCount(tu) - 1),
*GetSidSubAuthority (tg,
*GetSidSubAuthorityCount(tg) - 1),
*GetSidSubAuthorityCount(tg) - 1),
tu.string (strbuf), getenv ("HOME") ?: "/");
debug_printf ("Emulating /etc/passwd: %s", linebuf);
add_pwd_line (linebuf);
passwd_state = emulated;
}
CloseHandle (ptok);
}
}
}
if (passwd_state != emulated)
{

View File

@ -338,17 +338,17 @@ set_bits (select_record *me, fd_set *readfds, fd_set *writefds,
{
UNIX_FD_SET (me->fd, writefds);
if (me->except_on_write && me->fh->get_device () == FH_SOCKET)
((fhandler_socket *) me->fh)->set_connect_state (CONNECTED);
((fhandler_socket *) me->fh)->set_connect_state (CONNECTED);
ready++;
}
if ((me->except_selected || me->except_on_write) && me->except_ready)
{
if (me->except_on_write) /* Only on sockets */
{
{
UNIX_FD_SET (me->fd, writefds);
if (me->fh->get_device () == FH_SOCKET)
((fhandler_socket *) me->fh)->set_connect_state (CONNECTED);
}
}
if (me->except_selected)
UNIX_FD_SET (me->fd, exceptfds);
ready++;

View File

@ -218,11 +218,11 @@ tty_list::allocate_tty (int with_console)
__small_sprintf (buf, "cygwin.find.console.%d", myself->pid);
SetConsoleTitle (buf);
for (int times = 0; times < 25; times++)
{
Sleep (10);
if ((console = FindWindow (NULL, buf)))
{
Sleep (10);
if ((console = FindWindow (NULL, buf)))
break;
}
}
SetConsoleTitle (oldtitle);
Sleep (40);
ReleaseMutex (title_mutex);