attach_t (class process *const client)
: _client (client),
- _refcnt (0),
- _next (NULL)
+ _refcnt (0),
+ _next (NULL)
{}
};
attach_t (class process *const client)
: _client (client),
- _refcnt (0),
- _next (NULL)
+ _refcnt (0),
+ _next (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
{
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",
/* 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);
{
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;
}
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);
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:",
DWORD siz;
if (OpenProcessToken (hMainProc, TOKEN_QUERY, &ptok))
- {
+ {
if (GetTokenInformation (ptok, TokenUser, &tu, sizeof tu,
- &siz)
+ &siz)
&& GetTokenInformation (ptok, TokenPrimaryGroup, &tg,
sizeof tg, &siz))
{
"%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)
{
{
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++;
__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);