代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/coreutils 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8083944484f2cdf6c9b737642567bcdb54db784d Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.funk1@gmail.com>
Date: Sun, 6 Oct 2024 22:19:51 -0700
Subject: [PATCH] chroot,whoami: use uintmax_t for printing uids
Reference:https://github.com/coreutils/coreutils/commit/8083944484f2cdf6c9b737642567bcdb54db784d
* src/chroot.c (main): Cast the uid to uintmax_t instead of int.
* src/whoami.c (main): Cast the uid to uintmax_t instead of unsigned
long int.
---
src/chroot.c | 3 ++-
src/whoami.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/chroot.c b/src/chroot.c
index e12454c..dd1ec62 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -375,7 +375,8 @@ main (int argc, char **argv)
else if (gid_unset (gid))
{
error (EXIT_CANCELED, errno,
- _("no group specified for unknown uid: %d"), (int) uid);
+ _("no group specified for unknown uid: %ju"),
+ (uintmax_t) uid);
}
}
diff --git a/src/whoami.c b/src/whoami.c
index f64171d..834ca9f 100644
--- a/src/whoami.c
+++ b/src/whoami.c
@@ -81,8 +81,8 @@ main (int argc, char **argv)
uid = geteuid ();
pw = uid == NO_UID && errno ? nullptr : getpwuid (uid);
if (!pw)
- error (EXIT_FAILURE, errno, _("cannot find name for user ID %lu"),
- (unsigned long int) uid);
+ error (EXIT_FAILURE, errno, _("cannot find name for user ID %ju"),
+ (uintmax_t) uid);
puts (pw->pw_name);
return EXIT_SUCCESS;
}
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。