Commit Graph

10 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult 9ddc54918a os: xtrans: fix calloc overflow warning
The size of `int` is machine specific and may be 64 bits wide, which could
overflow the calloc'able size. Practically cannot happen here, since the
ListenTransCount can't go above MAX_CONNECTIONS, but compiler can't know
that and so spitting out a warning.

Using uint32_t really is sufficient here.

> ../os/connection.c: In function ‘CreateWellKnownSockets’:
> ../os/connection.c:274:22: warning: argument 1 range [18446744071562067968, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
>   274 |     ListenTransFds = calloc(ListenTransCount, sizeof(int));
>       |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:23:46 +02:00
Enrico Weigelt, metux IT consult 5d0b9f4508 os: xtrans: expand TRANS() macro to _XSERVTrans
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>
2025-06-30 13:08:06 +02:00
Enrico Weigelt, metux IT consult 8b3ab3586c os: xtrans: drop GetReopenInfo()
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:08:06 +02:00
Enrico Weigelt, metux IT consult 1d57896358 os: xtrans: drop TRANS_CLIENT code pathes
Not needed in server-only code base.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:08:06 +02:00
Enrico Weigelt, metux IT consult f6dd15f8d4 os: xtrans: drop ifdef TRANS_REOPEN
It's always defined, so the guards aren't necessary.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:08:06 +02:00
Enrico Weigelt, metux IT consult 13fd772406 os: xtrans: drop ifdef TRANS_SERVER
it's always defined, no extra guards needed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:08:06 +02:00
Enrico Weigelt, metux IT consult 1dbc9d03ac os: xtrans: drop NEED_UTSNAME
All our supported platforms have this utsname.h.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:08:06 +02:00
Enrico Weigelt, metux IT consult 70981fffb0 os: xtrans: drop FS_t
Not defined anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:08:06 +02:00
Enrico Weigelt, metux IT consult 6a2f1e7bdb os: xtrans: drop FONT_t
Not used anywhere, so no need to keep it around anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:08:06 +02:00
Enrico Weigelt, metux IT consult 6080bcf5b8 os: incorporate xtrans xtrans-1.6.0
Copy over from xtrans package, tag xtrans-1.6.0

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-30 13:08:06 +02:00