This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Request for help debugging screen problem


On Fri, Feb 05, 2010 at 02:46:48PM +0100, Corinna Vinschen wrote:
>On Feb  5 10:42, Shaddy Baddah wrote:
>> Hi,
>> 
>> I'm trying to debug a problem with screen, rather than publish a bug
>> report. I can do that as well if someone requests it, no problem.
>> 
>> The issue I'm facing is with a read on the Windows named pipe
>> associated with a tty device. I note that in this bit of code:
>> 
>> http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygserver/transport_pipes.cc?annotate=1.12&cvsroot=src
>> 
>> 223: ssize_t
>> 224: transport_layer_pipes::read (void *const buf, const size_t len)
>> 225: {
>> 226:   // verbose: debug_printf ("reading from pipe %p", _hPipe);
>> 227:
>> 228:   assert (_hPipe);
>> 229:   assert (_hPipe != INVALID_HANDLE_VALUE);
>> 230:   assert (!_is_listening_endpoint);
>> 231:
>> 232:   DWORD count;
>> 233:   if (!ReadFile (_hPipe, buf, len, &count, NULL))
>> 234:     {
>> 235:       debug_printf ("error reading from pipe (%lu)", GetLastError ());
>> 236:       SET_ERRNO (EINVAL);      // FIXME?
>> 237:       return -1;
>> 238:     }
>> 239:
>> 240:   return count;
>> 241: }
>> 242:
>> 
>> before and after the ReadFile the error code can return a different
>> value. ie. a call to the following function, returns different
>> values:
>> 
>> ssize_t client_request::error_code() const;
>> 
>> I'm curious as to how this could be. Is there some callback function
>> registered via the Windows API that ReadFile calls at various points
>> in its execution? Or is another thread setting this value?
>> 
>> Any help would be greatly appreciated.
>
>Can yopu expolain this in more detail, please?  What error codes
>are returned, and how do you trigger the effect?

Also, unless you have CYGWIN=server set, this code should not be used
by the pty handler so I don't know why you're looking here.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]