4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-01 03:50:28 +08:00

whitespace cleanup, update copyright

This commit is contained in:
Christopher Faylor 2002-03-13 02:34:05 +00:00
parent 2b1c041081
commit 73ea29f42c
21 changed files with 235 additions and 237 deletions

View File

@ -1,6 +1,6 @@
/* cygserver_client.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@ -98,7 +98,7 @@ client_request::send (transport_layer_base *conn)
if ((bytes_read = conn->read ((char *)&header, sizeof (header)))
!= sizeof (header) || (header.cb &&
(bytes_read = conn->read (buffer, header.cb) ) != header.cb))
(bytes_read = conn->read (buffer, header.cb)) != header.cb))
{
header.error_code = -1;
debug_printf("failed reading response \n");
@ -188,11 +188,11 @@ cygserver_init ()
if (rc < 0)
cygserver_running = CYGSERVER_DEAD;
else if (rc > 0)
api_fatal ( "error connecting to cygwin server. error: %d", rc );
api_fatal ("error connecting to cygwin server. error: %d", rc);
else if (req->version.major != CYGWIN_SERVER_VERSION_MAJOR ||
req->version.api != CYGWIN_SERVER_VERSION_API ||
req->version.minor > CYGWIN_SERVER_VERSION_MINOR)
api_fatal ( "incompatible version of cygwin server.\n\
api_fatal ("incompatible version of cygwin server.\n\
client version %d.%d.%d.%d, server version%ld.%ld.%ld.%ld",
CYGWIN_SERVER_VERSION_MAJOR,
CYGWIN_SERVER_VERSION_API,
@ -201,7 +201,7 @@ cygserver_init ()
req->version.major,
req->version.api,
req->version.minor,
req->version.patch );
req->version.patch);
else
cygserver_running = CYGSERVER_OK;
}

View File

@ -1,6 +1,6 @@
/* cygserver.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@ -47,26 +47,26 @@ setup_privileges ()
HANDLE hToken = NULL;
TOKEN_PRIVILEGES sPrivileges;
rc = OpenProcessToken ( GetCurrentProcess() , TOKEN_ALL_ACCESS , &hToken ) ;
if ( !rc )
rc = OpenProcessToken (GetCurrentProcess() , TOKEN_ALL_ACCESS , &hToken) ;
if (!rc)
{
printf ( "error opening process token (%lu)\n", GetLastError () );
printf ("error opening process token (%lu)\n", GetLastError ());
ret_val = FALSE;
goto out;
}
rc = LookupPrivilegeValue ( NULL, SE_DEBUG_NAME, &sPrivileges.Privileges[0].Luid );
if ( !rc )
rc = LookupPrivilegeValue (NULL, SE_DEBUG_NAME, &sPrivileges.Privileges[0].Luid);
if (!rc)
{
printf ( "error getting prigilege luid (%lu)\n", GetLastError () );
printf ("error getting prigilege luid (%lu)\n", GetLastError ());
ret_val = FALSE;
goto out;
}
sPrivileges.PrivilegeCount = 1 ;
sPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED ;
rc = AdjustTokenPrivileges ( hToken, FALSE, &sPrivileges, 0, NULL, NULL ) ;
if ( !rc )
rc = AdjustTokenPrivileges (hToken, FALSE, &sPrivileges, 0, NULL, NULL) ;
if (!rc)
{
printf ( "error adjusting prigilege level. (%lu)\n", GetLastError () );
printf ("error adjusting prigilege level. (%lu)\n", GetLastError ());
ret_val = FALSE;
goto out;
}
@ -79,7 +79,7 @@ setup_privileges ()
ret_val = TRUE;
out:
CloseHandle ( hToken );
CloseHandle (hToken);
return ret_val;
}
@ -100,14 +100,14 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
BOOL status;
if (from_process != GetCurrentProcess ())
{
{
if (!DuplicateHandle (from_process, from_handle,
GetCurrentProcess (), &local_handle,
0, bInheritHandle,
DUPLICATE_SAME_ACCESS))
{
printf ( "error getting handle(%u) to server (%lu)\n", (unsigned int)from_handle, GetLastError ());
printf ("error getting handle(%u) to server (%lu)\n", (unsigned int)from_handle, GetLastError ());
goto out;
}
} else
@ -117,7 +117,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
sd, sizeof (sd_buf), &bytes_needed))
{
printf ( "error getting handle SD (%lu)\n", GetLastError ());
printf ("error getting handle SD (%lu)\n", GetLastError ());
goto out;
}
@ -126,13 +126,13 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
if (!AccessCheck (sd, from_process_token, access, &access_mapping,
&ps, &ps_len, &access, &status))
{
printf ( "error checking access rights (%lu)\n", GetLastError ());
printf ("error checking access rights (%lu)\n", GetLastError ());
goto out;
}
if (!status)
{
printf ( "access to object denied\n");
printf ("access to object denied\n");
goto out;
}
@ -140,7 +140,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
to_process, to_handle_ptr,
access, bInheritHandle, 0))
{
printf ( "error getting handle to client (%lu)\n", GetLastError ());
printf ("error getting handle to client (%lu)\n", GetLastError ());
goto out;
}
debug_printf ("Duplicated %p to %p\n", from_handle, *to_handle_ptr);

View File

@ -1,6 +1,6 @@
/* cygserver_process.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
@ -138,7 +138,6 @@ process_cache::remove_process (class process *theprocess)
add_task (theprocess);
}
/* copy <= max_copy HANDLEs to dest[], starting at an offset into _our list_ of
* begin_at. (Ie begin_at = 5, the first copied handle is still written to dest[0]
* NOTE: Thread safe, but not thread guaranteed - a newly added process may be missed.

View File

@ -1,6 +1,6 @@
/* cygserver_shm.cc: Single unix specification IPC interface for Cygwin
Copyright 2001 Red Hat, Inc.
Copyright 2001, 2002 Red Hat, Inc.
Originally written by Robert Collins <robert.collins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver_shm.h
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* cygserver_transport.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver_transport_pipes.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver_transport_sockets.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@ -47,26 +47,26 @@ setup_privileges ()
HANDLE hToken = NULL;
TOKEN_PRIVILEGES sPrivileges;
rc = OpenProcessToken ( GetCurrentProcess() , TOKEN_ALL_ACCESS , &hToken ) ;
if ( !rc )
rc = OpenProcessToken (GetCurrentProcess() , TOKEN_ALL_ACCESS , &hToken) ;
if (!rc)
{
printf ( "error opening process token (%lu)\n", GetLastError () );
printf ("error opening process token (%lu)\n", GetLastError ());
ret_val = FALSE;
goto out;
}
rc = LookupPrivilegeValue ( NULL, SE_DEBUG_NAME, &sPrivileges.Privileges[0].Luid );
if ( !rc )
rc = LookupPrivilegeValue (NULL, SE_DEBUG_NAME, &sPrivileges.Privileges[0].Luid);
if (!rc)
{
printf ( "error getting prigilege luid (%lu)\n", GetLastError () );
printf ("error getting prigilege luid (%lu)\n", GetLastError ());
ret_val = FALSE;
goto out;
}
sPrivileges.PrivilegeCount = 1 ;
sPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED ;
rc = AdjustTokenPrivileges ( hToken, FALSE, &sPrivileges, 0, NULL, NULL ) ;
if ( !rc )
rc = AdjustTokenPrivileges (hToken, FALSE, &sPrivileges, 0, NULL, NULL) ;
if (!rc)
{
printf ( "error adjusting prigilege level. (%lu)\n", GetLastError () );
printf ("error adjusting prigilege level. (%lu)\n", GetLastError ());
ret_val = FALSE;
goto out;
}
@ -79,7 +79,7 @@ setup_privileges ()
ret_val = TRUE;
out:
CloseHandle ( hToken );
CloseHandle (hToken);
return ret_val;
}
@ -100,14 +100,14 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
BOOL status;
if (from_process != GetCurrentProcess ())
{
{
if (!DuplicateHandle (from_process, from_handle,
GetCurrentProcess (), &local_handle,
0, bInheritHandle,
DUPLICATE_SAME_ACCESS))
{
printf ( "error getting handle(%u) to server (%lu)\n", (unsigned int)from_handle, GetLastError ());
printf ("error getting handle(%u) to server (%lu)\n", (unsigned int)from_handle, GetLastError ());
goto out;
}
} else
@ -117,7 +117,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
sd, sizeof (sd_buf), &bytes_needed))
{
printf ( "error getting handle SD (%lu)\n", GetLastError ());
printf ("error getting handle SD (%lu)\n", GetLastError ());
goto out;
}
@ -126,13 +126,13 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
if (!AccessCheck (sd, from_process_token, access, &access_mapping,
&ps, &ps_len, &access, &status))
{
printf ( "error checking access rights (%lu)\n", GetLastError ());
printf ("error checking access rights (%lu)\n", GetLastError ());
goto out;
}
if (!status)
{
printf ( "access to object denied\n");
printf ("access to object denied\n");
goto out;
}
@ -140,7 +140,7 @@ check_and_dup_handle (HANDLE from_process, HANDLE to_process,
to_process, to_handle_ptr,
access, bInheritHandle, 0))
{
printf ( "error getting handle to client (%lu)\n", GetLastError ());
printf ("error getting handle to client (%lu)\n", GetLastError ());
goto out;
}
debug_printf ("Duplicated %p to %p\n", from_handle, *to_handle_ptr);

View File

@ -1,6 +1,6 @@
/* cygserver_client.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>
@ -98,7 +98,7 @@ client_request::send (transport_layer_base *conn)
if ((bytes_read = conn->read ((char *)&header, sizeof (header)))
!= sizeof (header) || (header.cb &&
(bytes_read = conn->read (buffer, header.cb) ) != header.cb))
(bytes_read = conn->read (buffer, header.cb)) != header.cb))
{
header.error_code = -1;
debug_printf("failed reading response \n");
@ -188,11 +188,11 @@ cygserver_init ()
if (rc < 0)
cygserver_running = CYGSERVER_DEAD;
else if (rc > 0)
api_fatal ( "error connecting to cygwin server. error: %d", rc );
api_fatal ("error connecting to cygwin server. error: %d", rc);
else if (req->version.major != CYGWIN_SERVER_VERSION_MAJOR ||
req->version.api != CYGWIN_SERVER_VERSION_API ||
req->version.minor > CYGWIN_SERVER_VERSION_MINOR)
api_fatal ( "incompatible version of cygwin server.\n\
api_fatal ("incompatible version of cygwin server.\n\
client version %d.%d.%d.%d, server version%ld.%ld.%ld.%ld",
CYGWIN_SERVER_VERSION_MAJOR,
CYGWIN_SERVER_VERSION_API,
@ -201,7 +201,7 @@ cygserver_init ()
req->version.major,
req->version.api,
req->version.minor,
req->version.patch );
req->version.patch);
else
cygserver_running = CYGSERVER_OK;
}

View File

@ -1,6 +1,6 @@
/* cygserver_process.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
@ -138,7 +138,6 @@ process_cache::remove_process (class process *theprocess)
add_task (theprocess);
}
/* copy <= max_copy HANDLEs to dest[], starting at an offset into _our list_ of
* begin_at. (Ie begin_at = 5, the first copied handle is still written to dest[0]
* NOTE: Thread safe, but not thread guaranteed - a newly added process may be missed.

View File

@ -1,6 +1,6 @@
/* cygserver_shm.cc: Single unix specification IPC interface for Cygwin
Copyright 2001 Red Hat, Inc.
Copyright 2001, 2002 Red Hat, Inc.
Originally written by Robert Collins <robert.collins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver_shm.h
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
This file is part of Cygwin.

View File

@ -1,6 +1,6 @@
/* cygserver_transport.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver_transport_pipes.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver_transport_sockets.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver.h
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru>

View File

@ -1,6 +1,6 @@
/* cygserver_process.h
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>

View File

@ -1,6 +1,6 @@
/* cygserver.cc
Copyright 2001 Red Hat Inc.
Copyright 2001, 2002 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>