mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
package/uemacs: fix call to cuserid
cuserid is deprecated and breaks the compilation on some new toolchains.
This patch fixes this issue.
Fixes:
#81
Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit a141b117e0)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
6be96dee22
commit
09c243a834
34
package/uemacs/02-Replace-cuserid.patch
Normal file
34
package/uemacs/02-Replace-cuserid.patch
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
From 289ccf8f0e77ae4f240eca988eb3a6ac19afbae9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
|
||||||
|
Date: Fri, 17 Jan 2025 22:10:41 +0100
|
||||||
|
Subject: [PATCH] Replace cuserid
|
||||||
|
|
||||||
|
cuserid has been removed from some toolchains and is no longer in the
|
||||||
|
POSIX standard since 1990. getlogin has been in the standard since 2001.
|
||||||
|
|
||||||
|
This commit uncomments the call to getlogin and thus replaces cuserid
|
||||||
|
with getlogin.
|
||||||
|
|
||||||
|
Upstream: https://github.com/torvalds/uemacs/pull/46
|
||||||
|
Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
|
||||||
|
---
|
||||||
|
pklock.c | 3 +--
|
||||||
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/pklock.c b/pklock.c
|
||||||
|
index dc30b76..5f4865b 100644
|
||||||
|
--- a/pklock.c
|
||||||
|
+++ b/pklock.c
|
||||||
|
@@ -80,8 +80,7 @@ char *dolock(char *fname)
|
||||||
|
}
|
||||||
|
if ((n = read(fd, locker, MAXNAME)) < 1) {
|
||||||
|
lseek(fd, 0, SEEK_SET);
|
||||||
|
-/* strcpy(locker, getlogin()); */
|
||||||
|
- cuserid(locker);
|
||||||
|
+ strcpy(locker, getlogin());
|
||||||
|
strcat(locker + strlen(locker), "@");
|
||||||
|
gethostname(locker + strlen(locker), 64);
|
||||||
|
write(fd, locker, strlen(locker));
|
||||||
|
--
|
||||||
|
2.48.1
|
||||||
|
|
||||||
Reference in New Issue
Block a user