*** empty log message ***
This commit is contained in:
parent
19ca46d5fb
commit
0312ede431
|
@ -38,7 +38,7 @@ details. */
|
||||||
|
|
||||||
#define MAX_AT_FILE_LEVEL 10
|
#define MAX_AT_FILE_LEVEL 10
|
||||||
|
|
||||||
#define PREMAIN_LEN (sizeof(user_data->premain) / sizeof (user_data->premain[0]))
|
#define PREMAIN_LEN (sizeof (user_data->premain) / sizeof (user_data->premain[0]))
|
||||||
|
|
||||||
HANDLE NO_COPY hMainProc = NULL;
|
HANDLE NO_COPY hMainProc = NULL;
|
||||||
HANDLE NO_COPY hMainThread = NULL;
|
HANDLE NO_COPY hMainThread = NULL;
|
||||||
|
@ -356,7 +356,7 @@ globify (char *word, char **&argv, int &argc, int &argvlen)
|
||||||
int n = 0;
|
int n = 0;
|
||||||
char *p, *s;
|
char *p, *s;
|
||||||
int dos_spec = isdrive (word);
|
int dos_spec = isdrive (word);
|
||||||
if (!dos_spec && isquote(*word) && word[1] && word[2])
|
if (!dos_spec && isquote (*word) && word[1] && word[2])
|
||||||
dos_spec = isdrive (word + 1);
|
dos_spec = isdrive (word + 1);
|
||||||
|
|
||||||
/* We'll need more space if there are quoting characters in
|
/* We'll need more space if there are quoting characters in
|
||||||
|
@ -601,7 +601,7 @@ alloc_stack (child_info_fork *ci)
|
||||||
api_fatal ("fork: couldn't get stack info, %E");
|
api_fatal ("fork: couldn't get stack info, %E");
|
||||||
|
|
||||||
if (sm.AllocationBase != ci->stacktop)
|
if (sm.AllocationBase != ci->stacktop)
|
||||||
alloc_stack_hard_way (ci, b + sizeof(b) - 1);
|
alloc_stack_hard_way (ci, b + sizeof (b) - 1);
|
||||||
else
|
else
|
||||||
ci->stacksize = 0;
|
ci->stacksize = 0;
|
||||||
}
|
}
|
||||||
|
@ -872,7 +872,7 @@ _dll_crt0 ()
|
||||||
if (GetEnvironmentVariable ("CYGWIN_SLEEP", buf, sizeof (buf)))
|
if (GetEnvironmentVariable ("CYGWIN_SLEEP", buf, sizeof (buf)))
|
||||||
{
|
{
|
||||||
small_printf ("Sleeping %d, pid %u\n", atoi (buf), GetCurrentProcessId ());
|
small_printf ("Sleeping %d, pid %u\n", atoi (buf), GetCurrentProcessId ());
|
||||||
Sleep (atoi(buf));
|
Sleep (atoi (buf));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* debug.cc
|
/* debug.cc
|
||||||
|
|
||||||
Copyright 1998, 1999, 2000 Cygnus Solutions.
|
Copyright 1998, 1999, 2000, 2001 Red Hat, Inc.
|
||||||
|
|
||||||
This software is a copyrighted work licensed under the terms of the
|
This software is a copyrighted work licensed under the terms of the
|
||||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||||
|
@ -31,7 +31,7 @@ typedef struct
|
||||||
} thread_info;
|
} thread_info;
|
||||||
|
|
||||||
static NO_COPY thread_info threads[32] = {{0, NULL}}; // increase as necessary
|
static NO_COPY thread_info threads[32] = {{0, NULL}}; // increase as necessary
|
||||||
#define NTHREADS (sizeof(threads) / sizeof(threads[0]))
|
#define NTHREADS (sizeof (threads) / sizeof (threads[0]))
|
||||||
|
|
||||||
void
|
void
|
||||||
threadname_init ()
|
threadname_init ()
|
||||||
|
@ -55,7 +55,7 @@ regthread (const char *name, DWORD tid)
|
||||||
}
|
}
|
||||||
|
|
||||||
int __stdcall
|
int __stdcall
|
||||||
iscygthread()
|
iscygthread ()
|
||||||
{
|
{
|
||||||
DWORD tid = GetCurrentThreadId ();
|
DWORD tid = GetCurrentThreadId ();
|
||||||
if (tid != mainthread.id)
|
if (tid != mainthread.id)
|
||||||
|
@ -256,7 +256,7 @@ add_handle (const char *func, int ln, HANDLE h, const char *name)
|
||||||
goto out; /* Already did this once */
|
goto out; /* Already did this once */
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hl = newh()) == NULL)
|
if ((hl = newh ()) == NULL)
|
||||||
{
|
{
|
||||||
unlock_debug ();
|
unlock_debug ();
|
||||||
system_printf ("couldn't allocate memory for %s(%d): %s(%p)",
|
system_printf ("couldn't allocate memory for %s(%d): %s(%p)",
|
||||||
|
|
|
@ -210,7 +210,7 @@ fhandler_console::read (void *pv, size_t buflen)
|
||||||
control_key_state & (LEFT_ALT_PRESSED | LEFT_CTRL_PRESSED) == LEFT_ALT_PRESSED | LEFT_CTRL_PRESSED
|
control_key_state & (LEFT_ALT_PRESSED | LEFT_CTRL_PRESSED) == LEFT_ALT_PRESSED | LEFT_CTRL_PRESSED
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
set_raw_win32_keyboard_mode ( !raw_win32_keyboard_mode );
|
set_raw_win32_keyboard_mode (!raw_win32_keyboard_mode);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -223,7 +223,7 @@ fhandler_console::read (void *pv, size_t buflen)
|
||||||
input_rec.Event.KeyEvent.wVirtualKeyCode,
|
input_rec.Event.KeyEvent.wVirtualKeyCode,
|
||||||
input_rec.Event.KeyEvent.wVirtualScanCode,
|
input_rec.Event.KeyEvent.wVirtualScanCode,
|
||||||
input_rec.Event.KeyEvent.uChar.UnicodeChar,
|
input_rec.Event.KeyEvent.uChar.UnicodeChar,
|
||||||
input_rec.Event.KeyEvent.dwControlKeyState );
|
input_rec.Event.KeyEvent.dwControlKeyState);
|
||||||
toadd = tmp;
|
toadd = tmp;
|
||||||
nread = strlen (toadd);
|
nread = strlen (toadd);
|
||||||
break;
|
break;
|
||||||
|
@ -537,12 +537,12 @@ fhandler_console::dup (fhandler_base *child)
|
||||||
fhc->dim_color = dim_color;
|
fhc->dim_color = dim_color;
|
||||||
fhc->state_ = state_;
|
fhc->state_ = state_;
|
||||||
fhc->nargs_ = nargs_;
|
fhc->nargs_ = nargs_;
|
||||||
for ( int i = 0; i < MAXARGS; i++ )
|
for (int i = 0; i < MAXARGS; i++)
|
||||||
fhc->args_[i] = args_[i];
|
fhc->args_[i] = args_[i];
|
||||||
fhc->rarg = rarg;
|
fhc->rarg = rarg;
|
||||||
fhc->saw_question_mark = saw_question_mark;
|
fhc->saw_question_mark = saw_question_mark;
|
||||||
|
|
||||||
strncpy ( fhc->my_title_buf, my_title_buf, TITLESIZE + 1) ;
|
strncpy (fhc->my_title_buf, my_title_buf, TITLESIZE + 1) ;
|
||||||
|
|
||||||
fhc->current_win32_attr = current_win32_attr;
|
fhc->current_win32_attr = current_win32_attr;
|
||||||
fhc->intensity = intensity;
|
fhc->intensity = intensity;
|
||||||
|
@ -772,7 +772,7 @@ fhandler_console::fhandler_console (const char *name) :
|
||||||
underline_color = FOREGROUND_GREEN | FOREGROUND_BLUE;
|
underline_color = FOREGROUND_GREEN | FOREGROUND_BLUE;
|
||||||
state_ = normal;
|
state_ = normal;
|
||||||
nargs_ = 0;
|
nargs_ = 0;
|
||||||
for ( int i = 0; i < MAXARGS; i++ ) args_ [i] = 0;
|
for (int i = 0; i < MAXARGS; i++) args_ [i] = 0;
|
||||||
savex = savey = 0;
|
savex = savey = 0;
|
||||||
scroll_region.Top = 0;
|
scroll_region.Top = 0;
|
||||||
scroll_region.Bottom = -1;
|
scroll_region.Bottom = -1;
|
||||||
|
@ -802,26 +802,26 @@ fhandler_console::get_win32_attr ()
|
||||||
{
|
{
|
||||||
WORD win_fg = fg;
|
WORD win_fg = fg;
|
||||||
WORD win_bg = bg;
|
WORD win_bg = bg;
|
||||||
if ( reverse )
|
if (reverse)
|
||||||
{
|
{
|
||||||
WORD save_fg = win_fg;
|
WORD save_fg = win_fg;
|
||||||
win_fg = ( win_bg & BACKGROUND_RED ? FOREGROUND_RED : 0 ) |
|
win_fg = (win_bg & BACKGROUND_RED ? FOREGROUND_RED : 0) |
|
||||||
( win_bg & BACKGROUND_GREEN ? FOREGROUND_GREEN : 0 ) |
|
(win_bg & BACKGROUND_GREEN ? FOREGROUND_GREEN : 0) |
|
||||||
( win_bg & BACKGROUND_BLUE ? FOREGROUND_BLUE : 0 ) |
|
(win_bg & BACKGROUND_BLUE ? FOREGROUND_BLUE : 0) |
|
||||||
( win_fg & FOREGROUND_INTENSITY );
|
(win_fg & FOREGROUND_INTENSITY);
|
||||||
win_bg = ( save_fg & FOREGROUND_RED ? BACKGROUND_RED : 0 ) |
|
win_bg = (save_fg & FOREGROUND_RED ? BACKGROUND_RED : 0) |
|
||||||
( save_fg & FOREGROUND_GREEN ? BACKGROUND_GREEN : 0 ) |
|
(save_fg & FOREGROUND_GREEN ? BACKGROUND_GREEN : 0) |
|
||||||
( save_fg & FOREGROUND_BLUE ? BACKGROUND_BLUE : 0 ) |
|
(save_fg & FOREGROUND_BLUE ? BACKGROUND_BLUE : 0) |
|
||||||
( win_bg & BACKGROUND_INTENSITY );
|
(win_bg & BACKGROUND_INTENSITY);
|
||||||
}
|
}
|
||||||
if ( underline ) win_fg = underline_color;
|
if (underline) win_fg = underline_color;
|
||||||
/* emulate blink with bright background */
|
/* emulate blink with bright background */
|
||||||
if ( blink ) win_bg |= BACKGROUND_INTENSITY;
|
if (blink) win_bg |= BACKGROUND_INTENSITY;
|
||||||
if ( intensity == INTENSITY_INVISIBLE )
|
if (intensity == INTENSITY_INVISIBLE)
|
||||||
win_fg = win_bg;
|
win_fg = win_bg;
|
||||||
else if ( intensity == INTENSITY_BOLD )
|
else if (intensity == INTENSITY_BOLD)
|
||||||
win_fg |= FOREGROUND_INTENSITY;
|
win_fg |= FOREGROUND_INTENSITY;
|
||||||
return ( win_fg | win_bg );
|
return (win_fg | win_bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -931,7 +931,7 @@ static const char base_chars[256] =
|
||||||
/*10 11 12 13 14 15 16 17 */ NOR, NOR, ERR, ERR, ERR, ERR, ERR, ERR,
|
/*10 11 12 13 14 15 16 17 */ NOR, NOR, ERR, ERR, ERR, ERR, ERR, ERR,
|
||||||
/*18 19 1A 1B 1C 1D 1E 1F */ NOR, NOR, ERR, ESC, ERR, ERR, ERR, ERR,
|
/*18 19 1A 1B 1C 1D 1E 1F */ NOR, NOR, ERR, ESC, ERR, ERR, ERR, ERR,
|
||||||
/* ! " # $ % & ' */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
/* ! " # $ % & ' */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
||||||
/*( ) * + , - . / */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
/*() * + , - . / */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
||||||
/*0 1 2 3 4 5 6 7 */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
/*0 1 2 3 4 5 6 7 */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
||||||
/*8 9 : ; < = > ? */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
/*8 9 : ; < = > ? */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
||||||
/*@ A B C D E F G */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
/*@ A B C D E F G */ NOR, NOR, NOR, NOR, NOR, NOR, NOR, NOR,
|
||||||
|
@ -1070,7 +1070,7 @@ fhandler_console::char_command (char c)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2000: /* Raw keyboard mode */
|
case 2000: /* Raw keyboard mode */
|
||||||
set_raw_win32_keyboard_mode ( (c == 'h') ? TRUE : FALSE );
|
set_raw_win32_keyboard_mode ((c == 'h') ? TRUE : FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* Ignore */
|
default: /* Ignore */
|
||||||
|
@ -1251,7 +1251,7 @@ fhandler_console::write_normal (const unsigned char *src,
|
||||||
CharToOemBuff ((LPCSTR)src, buf, l2);
|
CharToOemBuff ((LPCSTR)src, buf, l2);
|
||||||
else
|
else
|
||||||
strncpy (buf, (LPCSTR)src, l2);
|
strncpy (buf, (LPCSTR)src, l2);
|
||||||
if (! WriteFile (get_output_handle (), buf, l2, &done, 0))
|
if (!WriteFile (get_output_handle (), buf, l2, &done, 0))
|
||||||
{
|
{
|
||||||
debug_printf ("write failed, handle %p", get_output_handle ());
|
debug_printf ("write failed, handle %p", get_output_handle ());
|
||||||
__seterrno ();
|
__seterrno ();
|
||||||
|
|
|
@ -96,27 +96,27 @@ fhandler_dev_floppy::lseek (off_t offset, int whence)
|
||||||
PARTITION_INFORMATION pi;
|
PARTITION_INFORMATION pi;
|
||||||
DWORD bytes_read;
|
DWORD bytes_read;
|
||||||
|
|
||||||
if ( !DeviceIoControl ( get_handle(),
|
if (!DeviceIoControl (get_handle(),
|
||||||
IOCTL_DISK_GET_DRIVE_GEOMETRY,
|
IOCTL_DISK_GET_DRIVE_GEOMETRY,
|
||||||
NULL, 0,
|
NULL, 0,
|
||||||
&di, sizeof (di),
|
&di, sizeof (di),
|
||||||
&bytes_read, NULL) )
|
&bytes_read, NULL))
|
||||||
{
|
{
|
||||||
__seterrno ();
|
__seterrno ();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
debug_printf ( "disk geometry: (%ld cyl)*(%ld trk)*(%ld sec)*(%ld bps)",
|
debug_printf ("disk geometry: (%ld cyl)*(%ld trk)*(%ld sec)*(%ld bps)",
|
||||||
di.Cylinders.LowPart,
|
di.Cylinders.LowPart,
|
||||||
di.TracksPerCylinder,
|
di.TracksPerCylinder,
|
||||||
di.SectorsPerTrack,
|
di.SectorsPerTrack,
|
||||||
di.BytesPerSector );
|
di.BytesPerSector);
|
||||||
if ( DeviceIoControl ( get_handle (),
|
if (DeviceIoControl (get_handle (),
|
||||||
IOCTL_DISK_GET_PARTITION_INFO,
|
IOCTL_DISK_GET_PARTITION_INFO,
|
||||||
NULL, 0,
|
NULL, 0,
|
||||||
&pi, sizeof (pi),
|
&pi, sizeof (pi),
|
||||||
&bytes_read, NULL ))
|
&bytes_read, NULL))
|
||||||
{
|
{
|
||||||
debug_printf ( "partition info: %ld (%ld)",
|
debug_printf ("partition info: %ld (%ld)",
|
||||||
pi.StartingOffset.LowPart,
|
pi.StartingOffset.LowPart,
|
||||||
pi.PartitionLength.LowPart);
|
pi.PartitionLength.LowPart);
|
||||||
drive_size = (long long) pi.PartitionLength.QuadPart;
|
drive_size = (long long) pi.PartitionLength.QuadPart;
|
||||||
|
@ -126,7 +126,7 @@ fhandler_dev_floppy::lseek (off_t offset, int whence)
|
||||||
drive_size = (long long) di.Cylinders.QuadPart * di.TracksPerCylinder *
|
drive_size = (long long) di.Cylinders.QuadPart * di.TracksPerCylinder *
|
||||||
di.SectorsPerTrack * di.BytesPerSector;
|
di.SectorsPerTrack * di.BytesPerSector;
|
||||||
}
|
}
|
||||||
debug_printf ( "drive size: %ld", drive_size );
|
debug_printf ("drive size: %ld", drive_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (whence == SEEK_END && drive_size > 0)
|
if (whence == SEEK_END && drive_size > 0)
|
||||||
|
@ -161,7 +161,7 @@ fhandler_dev_floppy::lseek (off_t offset, int whence)
|
||||||
}
|
}
|
||||||
high = lloffset >> 32;
|
high = lloffset >> 32;
|
||||||
low = lloffset & 0xffffffff;
|
low = lloffset & 0xffffffff;
|
||||||
if ( high || (off_t) low < 0 )
|
if (high || (off_t) low < 0)
|
||||||
{
|
{
|
||||||
set_errno (EFBIG);
|
set_errno (EFBIG);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -48,17 +48,17 @@ SYSTEM_INFO system_info;
|
||||||
void __stdcall
|
void __stdcall
|
||||||
close_all_files (void)
|
close_all_files (void)
|
||||||
{
|
{
|
||||||
SetResourceLock(LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," close");
|
SetResourceLock (LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," close");
|
||||||
|
|
||||||
fhandler_base *fh;
|
fhandler_base *fh;
|
||||||
for (int i = 0; i < (int) fdtab.size; i++)
|
for (int i = 0; i < (int) fdtab.size; i++)
|
||||||
if ((fh = fdtab[i]) != NULL)
|
if ( (fh = fdtab[i]) != NULL)
|
||||||
{
|
{
|
||||||
fh->close ();
|
fh->close ();
|
||||||
fdtab.release (i);
|
fdtab.release (i);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReleaseResourceLock(LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," close");
|
ReleaseResourceLock (LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," close");
|
||||||
cygwin_shared->delqueue.process_queue ();
|
cygwin_shared->delqueue.process_queue ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,9 +421,9 @@ _open (const char *unix_path, int flags, ...)
|
||||||
sigframe thisframe (mainthread);
|
sigframe thisframe (mainthread);
|
||||||
|
|
||||||
syscall_printf ("open (%s, %p)", unix_path, flags);
|
syscall_printf ("open (%s, %p)", unix_path, flags);
|
||||||
if (!check_null_empty_path_errno(unix_path))
|
if (!check_null_empty_path_errno (unix_path))
|
||||||
{
|
{
|
||||||
SetResourceLock(LOCK_FD_LIST, WRITE_LOCK|READ_LOCK, " open ");
|
SetResourceLock (LOCK_FD_LIST, WRITE_LOCK|READ_LOCK, " open ");
|
||||||
|
|
||||||
/* check for optional mode argument */
|
/* check for optional mode argument */
|
||||||
va_start (ap, flags);
|
va_start (ap, flags);
|
||||||
|
@ -434,16 +434,16 @@ _open (const char *unix_path, int flags, ...)
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
set_errno (ENMFILE);
|
set_errno (ENMFILE);
|
||||||
else if ((fh = fdtab.build_fhandler (fd, unix_path, NULL)) == NULL)
|
else if ( (fh = fdtab.build_fhandler (fd, unix_path, NULL)) == NULL)
|
||||||
res = -1; // errno already set
|
res = -1; // errno already set
|
||||||
else if (!fh->open (unix_path, flags, (mode & 0777) & ~cygheap->umask))
|
else if (!fh->open (unix_path, flags, (mode & 0777) & ~cygheap->umask))
|
||||||
{
|
{
|
||||||
fdtab.release (fd);
|
fdtab.release (fd);
|
||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
else if ((res = fd) <= 2)
|
else if ( (res = fd) <= 2)
|
||||||
set_std_handle (res);
|
set_std_handle (res);
|
||||||
ReleaseResourceLock(LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," open");
|
ReleaseResourceLock (LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," open");
|
||||||
}
|
}
|
||||||
|
|
||||||
syscall_printf ("%d = open (%s, %p)", res, unix_path, flags);
|
syscall_printf ("%d = open (%s, %p)", res, unix_path, flags);
|
||||||
|
@ -456,9 +456,9 @@ _lseek (int fd, off_t pos, int dir)
|
||||||
off_t res;
|
off_t res;
|
||||||
sigframe thisframe (mainthread);
|
sigframe thisframe (mainthread);
|
||||||
|
|
||||||
if ( dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END )
|
if (dir != SEEK_SET && dir != SEEK_CUR && dir != SEEK_END)
|
||||||
{
|
{
|
||||||
set_errno ( EINVAL );
|
set_errno (EINVAL);
|
||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
else if (fdtab.not_open (fd))
|
else if (fdtab.not_open (fd))
|
||||||
|
@ -492,10 +492,10 @@ _close (int fd)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetResourceLock(LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," close");
|
SetResourceLock (LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," close");
|
||||||
res = fdtab[fd]->close ();
|
res = fdtab[fd]->close ();
|
||||||
fdtab.release (fd);
|
fdtab.release (fd);
|
||||||
ReleaseResourceLock(LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," close");
|
ReleaseResourceLock (LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," close");
|
||||||
}
|
}
|
||||||
|
|
||||||
syscall_printf ("%d = close (%d)", res, fd);
|
syscall_printf ("%d = close (%d)", res, fd);
|
||||||
|
@ -668,7 +668,7 @@ rel2abssd (PSECURITY_DESCRIPTOR psd_rel, PSECURITY_DESCRIPTOR psd_abs,
|
||||||
DWORD abslen)
|
DWORD abslen)
|
||||||
{
|
{
|
||||||
#ifdef _MT_SAFE
|
#ifdef _MT_SAFE
|
||||||
struct _winsup_t *r=_reent_winsup();
|
struct _winsup_t *r=_reent_winsup ();
|
||||||
char *dacl_buf=r->_dacl_buf;
|
char *dacl_buf=r->_dacl_buf;
|
||||||
char *sacl_buf=r->_sacl_buf;
|
char *sacl_buf=r->_sacl_buf;
|
||||||
char *ownr_buf=r->_ownr_buf;
|
char *ownr_buf=r->_ownr_buf;
|
||||||
|
@ -696,7 +696,7 @@ rel2abssd (PSECURITY_DESCRIPTOR psd_rel, PSECURITY_DESCRIPTOR psd_abs,
|
||||||
|
|
||||||
/* chown: POSIX 5.6.5.1 */
|
/* chown: POSIX 5.6.5.1 */
|
||||||
/*
|
/*
|
||||||
* chown() is only implemented for Windows NT. Under other operating
|
* chown () is only implemented for Windows NT. Under other operating
|
||||||
* systems, it is only a stub that always returns zero.
|
* systems, it is only a stub that always returns zero.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
|
@ -706,7 +706,7 @@ chown_worker (const char *name, unsigned fmode, uid_t uid, gid_t gid)
|
||||||
uid_t old_uid;
|
uid_t old_uid;
|
||||||
gid_t old_gid;
|
gid_t old_gid;
|
||||||
|
|
||||||
if (check_null_empty_path_errno(name))
|
if (check_null_empty_path_errno (name))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (os_being_run != winNT) // real chown only works on NT
|
if (os_being_run != winNT) // real chown only works on NT
|
||||||
|
@ -940,7 +940,7 @@ num_entries (const char *win32_name)
|
||||||
count ++;
|
count ++;
|
||||||
while (FindNextFileA (handle, &buf))
|
while (FindNextFileA (handle, &buf))
|
||||||
{
|
{
|
||||||
if ((buf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
if ( (buf.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
count ++;
|
count ++;
|
||||||
}
|
}
|
||||||
FindClose (handle);
|
FindClose (handle);
|
||||||
|
@ -1076,7 +1076,7 @@ stat_worker (const char *caller, const char *name, struct stat *buf,
|
||||||
strcpy (root, real_path.get_win32 ());
|
strcpy (root, real_path.get_win32 ());
|
||||||
dtype = GetDriveType (rootdir (root));
|
dtype = GetDriveType (rootdir (root));
|
||||||
|
|
||||||
if ((atts == -1 || !(atts & FILE_ATTRIBUTE_DIRECTORY) ||
|
if ( (atts == -1 || ! (atts & FILE_ATTRIBUTE_DIRECTORY) ||
|
||||||
(os_being_run == winNT
|
(os_being_run == winNT
|
||||||
&& dtype != DRIVE_NO_ROOT_DIR
|
&& dtype != DRIVE_NO_ROOT_DIR
|
||||||
&& dtype != DRIVE_UNKNOWN)))
|
&& dtype != DRIVE_UNKNOWN)))
|
||||||
|
@ -1106,7 +1106,7 @@ stat_worker (const char *caller, const char *name, struct stat *buf,
|
||||||
those subdirectories point to it.
|
those subdirectories point to it.
|
||||||
This is too slow on remote drives, so we do without it and
|
This is too slow on remote drives, so we do without it and
|
||||||
set the number of links to 2. */
|
set the number of links to 2. */
|
||||||
/* Unfortunately the count of 2 confuses `find(1)' command. So
|
/* Unfortunately the count of 2 confuses `find (1)' command. So
|
||||||
let's try it with `1' as link count. */
|
let's try it with `1' as link count. */
|
||||||
if (atts != -1 && (atts & FILE_ATTRIBUTE_DIRECTORY))
|
if (atts != -1 && (atts & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
buf->st_nlink = (dtype == DRIVE_REMOTE
|
buf->st_nlink = (dtype == DRIVE_REMOTE
|
||||||
|
@ -1127,7 +1127,7 @@ stat_worker (const char *caller, const char *name, struct stat *buf,
|
||||||
&& (atts & FILE_ATTRIBUTE_DIRECTORY)
|
&& (atts & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
&& dtype != DRIVE_REMOTE)
|
&& dtype != DRIVE_REMOTE)
|
||||||
buf->st_nlink = num_entries (real_path.get_win32 ());
|
buf->st_nlink = num_entries (real_path.get_win32 ());
|
||||||
buf->st_dev = FHDEVN(FH_DISK) << 8;
|
buf->st_dev = FHDEVN (FH_DISK) << 8;
|
||||||
buf->st_ino = hash_path_name (0, real_path.get_win32 ());
|
buf->st_ino = hash_path_name (0, real_path.get_win32 ());
|
||||||
if (atts != -1 && (atts & FILE_ATTRIBUTE_DIRECTORY))
|
if (atts != -1 && (atts & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
buf->st_mode = S_IFDIR;
|
buf->st_mode = S_IFDIR;
|
||||||
|
@ -1142,14 +1142,14 @@ stat_worker (const char *caller, const char *name, struct stat *buf,
|
||||||
&buf->st_mode, &buf->st_uid, &buf->st_gid))
|
&buf->st_mode, &buf->st_uid, &buf->st_gid))
|
||||||
{
|
{
|
||||||
buf->st_mode |= STD_RBITS | STD_XBITS;
|
buf->st_mode |= STD_RBITS | STD_XBITS;
|
||||||
if ((atts & FILE_ATTRIBUTE_READONLY) == 0)
|
if ( (atts & FILE_ATTRIBUTE_READONLY) == 0)
|
||||||
buf->st_mode |= STD_WBITS;
|
buf->st_mode |= STD_WBITS;
|
||||||
if (real_path.issymlink ())
|
if (real_path.issymlink ())
|
||||||
buf->st_mode |= S_IRWXU | S_IRWXG | S_IRWXO;
|
buf->st_mode |= S_IRWXU | S_IRWXG | S_IRWXO;
|
||||||
get_file_attribute (FALSE, real_path.get_win32 (),
|
get_file_attribute (FALSE, real_path.get_win32 (),
|
||||||
NULL, &buf->st_uid, &buf->st_gid);
|
NULL, &buf->st_uid, &buf->st_gid);
|
||||||
}
|
}
|
||||||
if ((handle = FindFirstFile (real_path.get_win32(), &wfd))
|
if ( (handle = FindFirstFile (real_path.get_win32 (), &wfd))
|
||||||
!= INVALID_HANDLE_VALUE)
|
!= INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
buf->st_atime = to_time_t (&wfd.ftLastAccessTime);
|
buf->st_atime = to_time_t (&wfd.ftLastAccessTime);
|
||||||
|
@ -1157,7 +1157,7 @@ stat_worker (const char *caller, const char *name, struct stat *buf,
|
||||||
buf->st_ctime = to_time_t (&wfd.ftCreationTime);
|
buf->st_ctime = to_time_t (&wfd.ftCreationTime);
|
||||||
buf->st_size = wfd.nFileSizeLow;
|
buf->st_size = wfd.nFileSizeLow;
|
||||||
buf->st_blksize = S_BLKSIZE;
|
buf->st_blksize = S_BLKSIZE;
|
||||||
buf->st_blocks = ((unsigned long) buf->st_size +
|
buf->st_blocks = ( (unsigned long) buf->st_size +
|
||||||
S_BLKSIZE-1) / S_BLKSIZE;
|
S_BLKSIZE-1) / S_BLKSIZE;
|
||||||
FindClose (handle);
|
FindClose (handle);
|
||||||
}
|
}
|
||||||
|
@ -1192,7 +1192,7 @@ access (const char *fn, int flags)
|
||||||
{
|
{
|
||||||
sigframe thisframe (mainthread);
|
sigframe thisframe (mainthread);
|
||||||
// flags were incorrectly specified
|
// flags were incorrectly specified
|
||||||
if (flags & ~(F_OK|R_OK|W_OK|X_OK))
|
if (flags & ~ (F_OK|R_OK|W_OK|X_OK))
|
||||||
{
|
{
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -1210,45 +1210,45 @@ access (const char *fn, int flags)
|
||||||
{
|
{
|
||||||
if (st.st_uid == myself->uid)
|
if (st.st_uid == myself->uid)
|
||||||
{
|
{
|
||||||
if (!(st.st_mode & S_IRUSR))
|
if (! (st.st_mode & S_IRUSR))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (st.st_gid == myself->gid)
|
else if (st.st_gid == myself->gid)
|
||||||
{
|
{
|
||||||
if (!(st.st_mode & S_IRGRP))
|
if (! (st.st_mode & S_IRGRP))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (!(st.st_mode & S_IROTH))
|
else if (! (st.st_mode & S_IROTH))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (flags & W_OK)
|
if (flags & W_OK)
|
||||||
{
|
{
|
||||||
if (st.st_uid == myself->uid)
|
if (st.st_uid == myself->uid)
|
||||||
{
|
{
|
||||||
if (!(st.st_mode & S_IWUSR))
|
if (! (st.st_mode & S_IWUSR))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (st.st_gid == myself->gid)
|
else if (st.st_gid == myself->gid)
|
||||||
{
|
{
|
||||||
if (!(st.st_mode & S_IWGRP))
|
if (! (st.st_mode & S_IWGRP))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (!(st.st_mode & S_IWOTH))
|
else if (! (st.st_mode & S_IWOTH))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (flags & X_OK)
|
if (flags & X_OK)
|
||||||
{
|
{
|
||||||
if (st.st_uid == myself->uid)
|
if (st.st_uid == myself->uid)
|
||||||
{
|
{
|
||||||
if (!(st.st_mode & S_IXUSR))
|
if (! (st.st_mode & S_IXUSR))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (st.st_gid == myself->gid)
|
else if (st.st_gid == myself->gid)
|
||||||
{
|
{
|
||||||
if (!(st.st_mode & S_IXGRP))
|
if (! (st.st_mode & S_IXGRP))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else if (!(st.st_mode & S_IXOTH))
|
else if (! (st.st_mode & S_IXOTH))
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
r = 0;
|
r = 0;
|
||||||
|
@ -1394,7 +1394,7 @@ system (const char *cmdstring)
|
||||||
command[2] = cmdstring;
|
command[2] = cmdstring;
|
||||||
command[3] = (const char *) NULL;
|
command[3] = (const char *) NULL;
|
||||||
|
|
||||||
if ((res = spawnvp (_P_WAIT, "sh", command)) == -1)
|
if ( (res = spawnvp (_P_WAIT, "sh", command)) == -1)
|
||||||
{
|
{
|
||||||
// when exec fails, return value should be as if shell
|
// when exec fails, return value should be as if shell
|
||||||
// executed exit (127)
|
// executed exit (127)
|
||||||
|
@ -1426,7 +1426,7 @@ extern "C" size_t
|
||||||
getpagesize ()
|
getpagesize ()
|
||||||
{
|
{
|
||||||
if (!system_info.dwPageSize)
|
if (!system_info.dwPageSize)
|
||||||
GetSystemInfo(&system_info);
|
GetSystemInfo (&system_info);
|
||||||
return (int) system_info.dwPageSize;
|
return (int) system_info.dwPageSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1503,7 +1503,7 @@ ttyname (int fd)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (char *)(fdtab[fd]->ttyname ());
|
return (char *) (fdtab[fd]->ttyname ());
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" char *
|
extern "C" char *
|
||||||
|
@ -1523,39 +1523,39 @@ ctermid (char *str)
|
||||||
extern "C" int
|
extern "C" int
|
||||||
_cygwin_istext_for_stdio (int fd)
|
_cygwin_istext_for_stdio (int fd)
|
||||||
{
|
{
|
||||||
syscall_printf("_cygwin_istext_for_stdio (%d)\n", fd);
|
syscall_printf ("_cygwin_istext_for_stdio (%d)\n", fd);
|
||||||
if (CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING)
|
if (CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING)
|
||||||
{
|
{
|
||||||
syscall_printf(" _cifs: old API\n");
|
syscall_printf (" _cifs: old API\n");
|
||||||
return 0; /* we do it for old apps, due to getc/putc macros */
|
return 0; /* we do it for old apps, due to getc/putc macros */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fdtab.not_open (fd))
|
if (fdtab.not_open (fd))
|
||||||
{
|
{
|
||||||
syscall_printf(" _cifs: fd not open\n");
|
syscall_printf (" _cifs: fd not open\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fhandler_base *p = fdtab[fd];
|
fhandler_base *p = fdtab[fd];
|
||||||
|
|
||||||
if (p->get_device() != FH_DISK)
|
if (p->get_device () != FH_DISK)
|
||||||
{
|
{
|
||||||
syscall_printf(" _cifs: fd not disk file\n");
|
syscall_printf (" _cifs: fd not disk file\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->get_w_binary () || p->get_r_binary ())
|
if (p->get_w_binary () || p->get_r_binary ())
|
||||||
{
|
{
|
||||||
syscall_printf(" _cifs: get_*_binary\n");
|
syscall_printf (" _cifs: get_*_binary\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
syscall_printf("_cygwin_istext_for_stdio says yes\n");
|
syscall_printf ("_cygwin_istext_for_stdio says yes\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* internal newlib function */
|
/* internal newlib function */
|
||||||
extern "C" int _fwalk (struct _reent *ptr, int (*function)(FILE *));
|
extern "C" int _fwalk (struct _reent *ptr, int (*function) (FILE *));
|
||||||
|
|
||||||
static int setmode_mode;
|
static int setmode_mode;
|
||||||
static int setmode_file;
|
static int setmode_file;
|
||||||
|
@ -1563,9 +1563,9 @@ static int setmode_file;
|
||||||
static int
|
static int
|
||||||
setmode_helper (FILE *f)
|
setmode_helper (FILE *f)
|
||||||
{
|
{
|
||||||
if (fileno(f) != setmode_file)
|
if (fileno (f) != setmode_file)
|
||||||
return 0;
|
return 0;
|
||||||
syscall_printf("setmode: file was %s now %s\n",
|
syscall_printf ("setmode: file was %s now %s\n",
|
||||||
f->_flags & __SCLE ? "cle" : "raw",
|
f->_flags & __SCLE ? "cle" : "raw",
|
||||||
setmode_mode & O_TEXT ? "cle" : "raw");
|
setmode_mode & O_TEXT ? "cle" : "raw");
|
||||||
if (setmode_mode & O_TEXT)
|
if (setmode_mode & O_TEXT)
|
||||||
|
@ -1633,7 +1633,7 @@ setmode (int fd, int mode)
|
||||||
else
|
else
|
||||||
setmode_mode = O_BINARY;
|
setmode_mode = O_BINARY;
|
||||||
setmode_file = fd;
|
setmode_file = fd;
|
||||||
_fwalk(_REENT, setmode_helper);
|
_fwalk (_REENT, setmode_helper);
|
||||||
|
|
||||||
syscall_printf ("setmode (%d, %s) returns %s\n", fd,
|
syscall_printf ("setmode (%d, %s) returns %s\n", fd,
|
||||||
mode&O_TEXT ? "text" : "binary",
|
mode&O_TEXT ? "text" : "binary",
|
||||||
|
@ -1718,7 +1718,7 @@ get_osfhandle (int fd)
|
||||||
{
|
{
|
||||||
res = (long) fdtab[fd]->get_handle ();
|
res = (long) fdtab[fd]->get_handle ();
|
||||||
}
|
}
|
||||||
syscall_printf ("%d = get_osfhandle(%d)", res, fd);
|
syscall_printf ("%d = get_osfhandle (%d)", res, fd);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -1733,7 +1733,7 @@ statfs (const char *fname, struct statfs *sfs)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
path_conv full_path(fname, PC_SYM_FOLLOW | PC_FULL);
|
path_conv full_path (fname, PC_SYM_FOLLOW | PC_FULL);
|
||||||
char *root = rootdir (full_path);
|
char *root = rootdir (full_path);
|
||||||
|
|
||||||
syscall_printf ("statfs %s", root);
|
syscall_printf ("statfs %s", root);
|
||||||
|
@ -1859,7 +1859,7 @@ ptsname (int fd)
|
||||||
set_errno (EBADF);
|
set_errno (EBADF);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (char *)(fdtab[fd]->ptsname ());
|
return (char *) (fdtab[fd]->ptsname ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: what is this? */
|
/* FIXME: what is this? */
|
||||||
|
@ -1924,26 +1924,26 @@ seteuid (uid_t uid)
|
||||||
if (uid != myself->uid)
|
if (uid != myself->uid)
|
||||||
if (uid == cygheap->user.orig_uid)
|
if (uid == cygheap->user.orig_uid)
|
||||||
{
|
{
|
||||||
debug_printf ("RevertToSelf() (uid == orig_uid, token=%d)",
|
debug_printf ("RevertToSelf () (uid == orig_uid, token=%d)",
|
||||||
cygheap->user.token);
|
cygheap->user.token);
|
||||||
RevertToSelf();
|
RevertToSelf ();
|
||||||
if (cygheap->user.token != INVALID_HANDLE_VALUE)
|
if (cygheap->user.token != INVALID_HANDLE_VALUE)
|
||||||
cygheap->user.impersonated = FALSE;
|
cygheap->user.impersonated = FALSE;
|
||||||
}
|
}
|
||||||
else if (!cygheap->user.impersonated)
|
else if (!cygheap->user.impersonated)
|
||||||
{
|
{
|
||||||
debug_printf ("Impersonate(uid == %d)", uid);
|
debug_printf ("Impersonate (uid == %d)", uid);
|
||||||
RevertToSelf();
|
RevertToSelf ();
|
||||||
if (cygheap->user.token != INVALID_HANDLE_VALUE)
|
if (cygheap->user.token != INVALID_HANDLE_VALUE)
|
||||||
if (!ImpersonateLoggedOnUser (cygheap->user.token))
|
if (!ImpersonateLoggedOnUser (cygheap->user.token))
|
||||||
system_printf ("Impersonate(%d) in set(e)uid failed: %E",
|
system_printf ("Impersonate (%d) in set (e)uid failed: %E",
|
||||||
cygheap->user.token);
|
cygheap->user.token);
|
||||||
else
|
else
|
||||||
cygheap->user.impersonated = TRUE;
|
cygheap->user.impersonated = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
cygheap_user user;
|
cygheap_user user;
|
||||||
/* user.token is used in internal_getlogin() to determine if
|
/* user.token is used in internal_getlogin () to determine if
|
||||||
impersonation is active. If so, the token is used for
|
impersonation is active. If so, the token is used for
|
||||||
retrieving user's SID. */
|
retrieving user's SID. */
|
||||||
user.token = cygheap->user.impersonated ? cygheap->user.token
|
user.token = cygheap->user.impersonated ? cygheap->user.token
|
||||||
|
@ -1996,7 +1996,7 @@ chroot (const char *newroot)
|
||||||
{
|
{
|
||||||
sigframe thisframe (mainthread);
|
sigframe thisframe (mainthread);
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
path_conv path(newroot, PC_SYM_FOLLOW | PC_FULL);
|
path_conv path (newroot, PC_SYM_FOLLOW | PC_FULL);
|
||||||
|
|
||||||
if (path.error)
|
if (path.error)
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -2005,7 +2005,7 @@ chroot (const char *newroot)
|
||||||
set_errno (ENOENT);
|
set_errno (ENOENT);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (!(path.file_attributes () & FILE_ATTRIBUTE_DIRECTORY))
|
if (! (path.file_attributes () & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
{
|
{
|
||||||
set_errno (ENOTDIR);
|
set_errno (ENOTDIR);
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -2068,7 +2068,7 @@ wcscmp (const wchar_t *s1, const wchar_t *s2)
|
||||||
s2++;
|
s2++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (*(unsigned short *) s1) - (*(unsigned short *) s2);
|
return (* (unsigned short *) s1) - (* (unsigned short *) s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" size_t
|
extern "C" size_t
|
||||||
|
@ -2203,7 +2203,7 @@ login (struct utmp *ut)
|
||||||
(void) write (fd, (char *) ut, sizeof (struct utmp));
|
(void) write (fd, (char *) ut, sizeof (struct utmp));
|
||||||
(void) close (fd);
|
(void) close (fd);
|
||||||
}
|
}
|
||||||
if ((fd = open (_PATH_WTMP, O_WRONLY | O_APPEND | O_BINARY, 0)) >= 0)
|
if ( (fd = open (_PATH_WTMP, O_WRONLY | O_APPEND | O_BINARY, 0)) >= 0)
|
||||||
{
|
{
|
||||||
(void) write (fd, (char *) ut, sizeof (struct utmp));
|
(void) write (fd, (char *) ut, sizeof (struct utmp));
|
||||||
(void) close (fd);
|
(void) close (fd);
|
||||||
|
@ -2211,7 +2211,7 @@ login (struct utmp *ut)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* It isn't possible to use unix-style I/O function in logout code because
|
/* It isn't possible to use unix-style I/O function in logout code because
|
||||||
cygwin's I/O subsystem may be inaccessible at logout() call time.
|
cygwin's I/O subsystem may be inaccessible at logout () call time.
|
||||||
FIXME (cgf): huh?
|
FIXME (cgf): huh?
|
||||||
*/
|
*/
|
||||||
extern "C" int
|
extern "C" int
|
||||||
|
@ -2243,7 +2243,7 @@ logout (char *line)
|
||||||
while (!res && ReadFile (ut_fd, ut_buf, sizeof ut_buf, &rd, NULL)
|
while (!res && ReadFile (ut_fd, ut_buf, sizeof ut_buf, &rd, NULL)
|
||||||
&& rd != 0)
|
&& rd != 0)
|
||||||
{
|
{
|
||||||
struct utmp *ut_end = (struct utmp *) ((char *) ut_buf + rd);
|
struct utmp *ut_end = (struct utmp *) ( (char *) ut_buf + rd);
|
||||||
|
|
||||||
for (ut = ut_buf; ut < ut_end; ut++, pos += sizeof (*ut))
|
for (ut = ut_buf; ut < ut_end; ut++, pos += sizeof (*ut))
|
||||||
if (ut->ut_name[0]
|
if (ut->ut_name[0]
|
||||||
|
@ -2257,7 +2257,7 @@ logout (char *line)
|
||||||
|
|
||||||
/* Now seek back to the position in utmp at which UT occured,
|
/* Now seek back to the position in utmp at which UT occured,
|
||||||
and write the new version of UT there. */
|
and write the new version of UT there. */
|
||||||
if ((SetFilePointer (ut_fd, pos, 0, FILE_BEGIN) != 0xFFFFFFFF)
|
if ( (SetFilePointer (ut_fd, pos, 0, FILE_BEGIN) != 0xFFFFFFFF)
|
||||||
&& (WriteFile (ut_fd, (char *) ut, sizeof (*ut),
|
&& (WriteFile (ut_fd, (char *) ut, sizeof (*ut),
|
||||||
&rd, NULL)))
|
&rd, NULL)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue