]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
login: retire use of __FUNCTION__ macro
authorKarel Zak <kzak@redhat.com>
Thu, 23 May 2019 19:27:37 +0000 (20:27 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 27 May 2019 09:55:19 +0000 (11:55 +0200)
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 <kerolasa@iki.fi>
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 <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.c

index a2d2725a6216b9ec0ab0efa25c35d53ce0980f6d..ce112b54ebcae9482ed056d2e471bab1ad103781 100644 (file)
@@ -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);
        }