From: Karel Zak Date: Thu, 23 May 2019 19:27:37 +0000 (+0100) Subject: login: retire use of __FUNCTION__ macro X-Git-Tag: v2.34-rc2~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c6167c394bf5a7c374a6bd626478e1079facebe;p=thirdparty%2Futil-linux.git 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 --- diff --git a/login-utils/login.c b/login-utils/login.c index a2d2725a62..ce112b54eb 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); }