> In file included from /usr/include/ctype.h:100,
> from ../include/misc.h:154,
> from ../include/os.h:51,
> from ../os/Xtransint.h:256,
> from ../os/transport.c:57:
> ../os/Xtranssock.c: In function ‘is_numeric’:
> ../os/Xtranssock.c:217:19: error: array subscript has type ‘char’ [-Werror=char-subscripts]
> 217 | if (!isdigit (str[i]))
> | ^
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Mingw32 also supports unix sockets, so no need to disable them here.
Since it's now always enabled, follow-up commits can now drop all the
extra #ifdef's on UNIXCONN and so reduce complexity.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ../os/Xtranssock.c:494:5: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-truncation]
> 494 | strncpy(addr->sa_data, port, portlen);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../os/Xtranssock.c:446:15: note: length computed here
> 446 | portlen = strlen(port) + 1; // include space for trailing null
> | ^~~~~~~~~~~~
Since we already know the string length, we can just use memcpy()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not used anywhere, so no need to keep it around anymore.
Also dropping the BytesReadable vector, which is unused now.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
size_t is unsigned, but might have different sizes depending on CPU arch,
so casting it to unsigned long, so we can safely use %ld.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since everything's running via Writev() methods now, the now unused Write()
methods can all be dropped.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Now that all WriteV() methods are operating on single buffer instead ofiovec's,
we don't need the complicated _XSERVTransWriteV() anymore, but instead can
write directly to the socket/fd.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since they're only called with a one-element iovec, we can use a single
buffer pointer straight away, thus making it quite the same as the old
Write() methods.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Refactor _XSERVTransWriteV() to call write() on Unix and instead drop
the WRITEV() macro.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Reducing the ifdef-zoo a bit by moving the platform specific socket
close calls into separate function. On win32, this also checks the
retval and potentially query for error. On Unix, just calling close().
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Reducing the ifdef-zoo a bit by moving the platform specific socket
ioctl calls into separate function. On win32, this also checks the
retval and potentially query for error. On Unix, just calling ioctl().
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
A socket() call either returns a valid socket fd or -1, there's no need for
trying to check whether the returned fd is out of the OS's allowed range
of fd's, because if it would, the kernel would return error anyways.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Instead of redefining existing standard libc symbols, pick another symbol
that's mapped to the corresponding platform specific function.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
It's not used anywhere, so no need to keep it around anymore.
We can also dispose the corresponding connection driver's procs here.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since TRANS() now will always expand the same, it's better for
maintenance, having the function names written explicitly.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
These are always enablde (x11_t is defined when XSERV_t is defined),
so no need for the #ifdef's anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>