+2006-07-17 Christopher Faylor <cgf@timesys.com>
+
+ GCC 4.1 fixes.
+ * cygheap.h (cygheap_user): Remove unneeded class names from function
+ declaration.
+ * fhandler.h (fhandler_base): Ditto.
+ (fhandler_dev_floppy): Ditto.
+ (fhandler_console): Ditto.
+ * wininfo.h (wininfo): Ditto.
+ * exceptions.cc (sigpacket::process): Avoid compiler errors about gotos
+ and initialization.
+ * fhandler_fifo.cc (fhandler_fifo::open): Ditto.
+ * fhandler_floppy.cc (fhandler_dev_floppy::ioctl): Ditto.
+ * fhandler_tty.cc (fhandler_tty_slave::ioctl): Ditto.
+ * mmap.cc (mmap64): Ditto.
+ * pipe.cc (fhandler_pipe::open): Ditto.
+ * spawn.cc (spawn_guts): Ditto.
+
+ * sec_helper.cc: Fix some comments.
+ (get_null_sd): Move file-scope static to only function where it is
+ used.
+
2006-07-14 Christopher Faylor <cgf@timesys.com>
* fork.cc (fork): Lock the process before forking to prevent things
return strcpy (buf, name ());
}
- const char *cygheap_user::test_uid (char *&, const char *, size_t)
+ const char *test_uid (char *&, const char *, size_t)
__attribute__ ((regparm (3)));
};
sigpacket::process ()
{
DWORD continue_now;
+ struct sigaction dummy = global_sigs[SIGSTOP];
+
if (si.si_signo != SIGCONT)
continue_now = false;
else
if (ISSTATE (myself, PID_STOPPED))
goto done;
handler = (void *) sig_handle_tty_stop;
- struct sigaction dummy = global_sigs[SIGSTOP];
thissig = dummy;
dosig:
__attribute__ ((regparm (3)));
int __stdcall fstat_by_handle (struct __stat64 *buf) __attribute__ ((regparm (2)));
int __stdcall fstat_by_name (struct __stat64 *buf) __attribute__ ((regparm (2)));
- int fhandler_base::utimes_fs (const struct timeval *) __attribute__ ((regparm (2)));
+ int utimes_fs (const struct timeval *) __attribute__ ((regparm (2)));
virtual int __stdcall fchmod (mode_t mode) __attribute__ ((regparm (1)));
virtual int __stdcall fchown (__uid32_t uid, __gid32_t gid) __attribute__ ((regparm (2)));
virtual int __stdcall facl (int, int, __acl32 *) __attribute__ ((regparm (3)));
IMPLEMENT_STATUS_FLAG (bool, eom_detected)
inline _off64_t get_current_position ();
- int fhandler_dev_floppy::get_drive_info (struct hd_geometry *geo);
+ int get_drive_info (struct hd_geometry *geo);
BOOL write_file (const void *buf, DWORD to_write, DWORD *written, int *err);
BOOL read_file (void *buf, DWORD to_read, DWORD *read, int *err);
static tty_min *get_tty_stuff (int);
bool is_slow () {return 1;}
static bool need_invisible ();
- static bool fhandler_console::has_a () {return !invisible_console;}
+ static bool has_a () {return !invisible_console;}
};
class fhandler_tty_common: public fhandler_termios
char mutex[CYG_MAX_PATH];
char *emutex = mutex + CYG_MAX_PATH;
char *p, *p1;
+ DWORD resw;
/* Generate a semi-unique name to associate with this fifo but try to ensure
that it is no larger than CYG_MAX_PATH */
open an fd. */
/* FIXME? Need to wait for signal here?
This shouldn't block for long, but... */
- DWORD resw = WaitForSingleObject (h, INFINITE);
+ resw = WaitForSingleObject (h, INFINITE);
lock_process::locker.acquire (); /* Restore the lock */
if (resw != WAIT_OBJECT_0 && resw != WAIT_ABANDONED_0)
{
/* Just check the restriction that blocksize must be a multiple
of the sector size of the underlying volume sector size,
then fall through to fhandler_dev_raw::ioctl. */
- struct rdop *op = (struct rdop *) buf;
- if (op->rd_parm % bytes_per_sector)
+ if (((struct rdop *) buf)->rd_parm % bytes_per_sector)
{
SetLastError (ERROR_INVALID_PARAMETER);
__seterrno ();
get_ttyp ()->cmd = cmd;
get_ttyp ()->ioctl_retval = 0;
+ int val;
switch (cmd)
{
case TIOCGWINSZ:
}
break;
case TIOCLINUX:
- int val = *(unsigned char *) arg;
+ val = *(unsigned char *) arg;
if (val != 6 || !ioctl_request_event || !ioctl_done_event)
get_ttyp ()->ioctl_retval = -EINVAL;
else
caddr_t base = NULL;
DWORD pagesize = getpagesize ();
+ DWORD checkpagesize;
fh_anonymous.set_io_handle (INVALID_HANDLE_VALUE);
fh_anonymous.set_access (GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE);
at least most of the time is, allow 4K aligned addresses in 98,
to enable remapping of formerly mapped pages. If no matching
free pages exist, check addr again, this time for the real alignment. */
- DWORD checkpagesize = wincap.has_mmap_alignment_bug () ?
- getsystempagesize () : pagesize;
+ checkpagesize = wincap.has_mmap_alignment_bug () ?
+ getsystempagesize () : pagesize;
if (fixed (flags) && ((uintptr_t) addr % checkpagesize))
{
set_errno (EINVAL);
fhandler_pipe *fh = NULL;
size_t size;
int pid, rwflags = (flags & O_ACCMODE);
+ bool inh;
sscanf (get_name (), "/proc/%d/fd/pipe:[%d]", &pid, (int *) &pipe_hdl);
if (pid == myself->pid)
set_errno (EACCES);
goto out;
}
- bool inh = !(flags & O_NOINHERIT);
+ inh = !(flags & O_NOINHERIT);
if (!DuplicateHandle (proc, pipe_hdl, hMainProc, &nio_hdl,
0, inh, DUPLICATE_SAME_ACCESS))
{
set_privilege (token, SE_CHANGE_NOTIFY_PRIV, !allow_traverse);
}
-/*
- * Function to return a common SECURITY_DESCRIPTOR * that
- * allows all access.
- */
+/* Function to return a common SECURITY_DESCRIPTOR that
+ allows all access. */
-static NO_COPY SECURITY_DESCRIPTOR *null_sdp = 0;
SECURITY_DESCRIPTOR *__stdcall
get_null_sd ()
{
static NO_COPY SECURITY_DESCRIPTOR sd;
+ static NO_COPY SECURITY_DESCRIPTOR *null_sdp;
- if (null_sdp == 0)
+ if (!null_sdp)
{
InitializeSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl (&sd, TRUE, 0, FALSE);
return null_sdp;
}
-/*
- * Initialize global security attributes.
- *
- * Called from dcrt0.cc (_dll_crt0).
- */
+/* Initialize global security attributes.
+ Called from dcrt0.cc (_dll_crt0). */
void
init_global_security ()
path_conv real_path;
bool reset_sendsig = false;
+ const char *runpath;
+ int c_flags;
+ bool wascygexec;
+ cygheap_exec_info *moreinfo;
+
bool null_app_name = false;
STARTUPINFO si = {0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL};
int looped = 0;
else
chtype = PROC_EXEC;
- cygheap_exec_info *moreinfo = (cygheap_exec_info *) ccalloc (HEAP_1_EXEC, 1, sizeof (cygheap_exec_info));
+ moreinfo = (cygheap_exec_info *) ccalloc (HEAP_1_EXEC, 1, sizeof (cygheap_exec_info));
moreinfo->old_title = NULL;
/* CreateProcess takes one long string that is the command line (sigh).
goto out;
}
- bool wascygexec = real_path.iscygexec ();
+
+ wascygexec = real_path.iscygexec ();
res = newargv.fixup (prog_arg, real_path, ext);
if (res)
si.wShowWindow = SW_HIDE;
}
- int c_flags = GetPriorityClass (hMainProc);
+ c_flags = GetPriorityClass (hMainProc);
sigproc_printf ("priority class %d", c_flags);
c_flags |= CREATE_SEPARATE_WOW_VDM;
|| cygheap->fdtab.need_fixup_before ()))
c_flags |= CREATE_SUSPENDED;
- const char *runpath = null_app_name ? NULL : (const char *) real_path;
+ runpath = null_app_name ? NULL : (const char *) real_path;
syscall_printf ("null_app_name %d (%s, %.9500s)", null_app_name, runpath, one_line.buf);
{
char *pgm = NULL;
char *arg1 = NULL;
+ char *ptr, *buf;
HANDLE h = CreateFile (real_path, GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
}
goto err;
}
- char *buf = (char *) MapViewOfFile(hm, FILE_MAP_READ, 0, 0, 0);
+ buf = (char *) MapViewOfFile(hm, FILE_MAP_READ, 0, 0, 0);
CloseHandle (hm);
if (!buf)
goto err;
debug_printf ("%s is possibly a script", (char *) real_path);
- char *ptr = buf;
+ ptr = buf;
if (*ptr++ == '#' && *ptr++ == '!')
{
ptr += strspn (ptr, " \t");
static muto _lock;
public:
operator HWND ();
- int __stdcall wininfo::process (HWND, UINT, WPARAM, LPARAM)
+ int __stdcall process (HWND, UINT, WPARAM, LPARAM)
__attribute__ ((regparm (3)));
void lock ();
void release ();