From 9c6167c394bf5a7c374a6bd626478e1079facebe Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 23 May 2019 20:27:37 +0100 Subject: login: retire use of __FUNCTION__ macro This fixes following warning about deprecatd __FUNCTION__ that is another name for __func__ since GCC (pre 2.95, released July 1999). login-utils/login.c:860:10: warning: ISO C does not support ‘__FUNCTION__’ predefined identifier [-Wpedantic] Co-Author: Sami Kerola Reference: https://c0x.coding-guidelines.com/6.4.2.2.html Reference: https://github.com/karelzak/util-linux/pull/802 Signed-off-by: Sami Kerola Signed-off-by: Karel Zak --- login-utils/login.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/login-utils/login.c b/login-utils/login.c index a2d2725a6..ce112b54e 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -856,8 +856,7 @@ static void loginpam_acct(struct login_context *cxt) if (!cxt->username || !*cxt->username) { warnx(_("\nSession setup problem, abort.")); - syslog(LOG_ERR, _("NULL user name in %s:%d. Abort."), - __FUNCTION__, __LINE__); + syslog(LOG_ERR, _("NULL user name. Abort.")); pam_end(pamh, PAM_SYSTEM_ERR); sleepexit(EXIT_FAILURE); } @@ -1246,8 +1245,8 @@ int main(int argc, char **argv) cxt.pwd = xgetpwnam(cxt.username, &cxt.pwdbuf); if (!cxt.pwd) { warnx(_("\nSession setup problem, abort.")); - syslog(LOG_ERR, _("Invalid user name \"%s\" in %s:%d. Abort."), - cxt.username, __FUNCTION__, __LINE__); + syslog(LOG_ERR, _("Invalid user name \"%s\". Abort."), + cxt.username); pam_end(cxt.pamh, PAM_SYSTEM_ERR); sleepexit(EXIT_FAILURE); } -- cgit v1.2.3-55-g7522