Re: [PATCH 1/2] Use a newtype for remote file descriptor

Tom Tromey
2026-02-27T13:37:11Z

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

>> target_debug_printf_nofunc ("target_fileio_open (%d,%s,0x%x,0%o,%d) = %d (%d)",
>> - inf == NULL ? 0 : inf->num, filename, flags, mode,
>> - warn_if_slow, fd, fd != -1 ? 0 : *target_errno);
>> - return fd;
>> + inf == NULL ? 0 : inf->num, filename,
>> + flags, mode, warn_if_slow, int (fd),
>> + int (fd) != -1 ? 0 : *target_errno);
>> + return result;

Simon> One more nit: in this function, you don't need to case fd to int, since
Simon> fd is an int. You could either remove the cast, or use `result` in the
Simon> debug print.

Yeah, I meant to use result there, I've fixed this.

Tom