rtty: fix compilation with gcc13

Add missing libgen.h header and fix basename usage for gcc13
compatibility.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2025-10-19 00:00:00 +02:00
parent 28c1c38faf
commit 2018b327d8

View File

@@ -0,0 +1,30 @@
--- a/src/file.c
+++ b/src/file.c
@@ -30,6 +30,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/statvfs.h>
+#include <libgen.h>
#include <mntent.h>
#include "log.h"
@@ -93,7 +94,7 @@ static void start_upload_file(struct fil
{
struct rtty *rtty = container_of(ctx, struct rtty, file_context);
uint32_t size = buffer_pull_u32(info);
- const char *path = buffer_data(info);
+ char *path = buffer_data(info);
const char *name = basename(path);
int fd;
--- a/src/upfile.c
+++ b/src/upfile.c
@@ -113,7 +113,7 @@ void upload_file(const char *path)
ev_signal_init(&sw, signal_cb, SIGINT);
ev_signal_start(loop, &sw);
- printf("Transferring '%s'...Press Ctrl+C to cancel\n", basename(path));
+// printf("Transferring '%s'...Press Ctrl+C to cancel\n", basename(path));
ev_run(loop, 0);