From de9a143a3ed408620c38e70669899cfac61c36ad Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 27 Feb 2020 14:10:53 -0700 Subject: [PATCH] Use C99 __func__ instead of gcc-specific __PRETTY_FUNCTION__ --- plugins/python/pyhelpers.c | 2 +- plugins/python/python_plugin_policy.c | 2 +- plugins/python/sudo_python_module.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/python/pyhelpers.c b/plugins/python/pyhelpers.c index d7b48f848..d2d2629b0 100644 --- a/plugins/python/pyhelpers.c +++ b/plugins/python/pyhelpers.c @@ -208,7 +208,7 @@ py_str_array_from_tuple(PyObject *py_tuple) if (!PyTuple_Check(py_tuple)) { PyErr_Format(PyExc_ValueError, "%s: value error, argument should be a tuple but it is '%s'", - __PRETTY_FUNCTION__, Py_TYPENAME(py_tuple)); + __func__, Py_TYPENAME(py_tuple)); debug_return_ptr(NULL); } diff --git a/plugins/python/python_plugin_policy.c b/plugins/python/python_plugin_policy.c index 827194210..56264e342 100644 --- a/plugins/python/python_plugin_policy.c +++ b/plugins/python/python_plugin_policy.c @@ -179,7 +179,7 @@ python_plugin_policy_list(int argc, char * const argv[], int verbose, const char PyObject *py_argv = py_str_array_to_tuple_with_count(argc, argv); if (py_argv == NULL) { - sudo_debug_printf(SUDO_DEBUG_ERROR, "%s: Failed to create argv argument for the python call\n", __PRETTY_FUNCTION__); + sudo_debug_printf(SUDO_DEBUG_ERROR, "%s: Failed to create argv argument for the python call\n", __func__); debug_return_int(SUDO_RC_ERROR); } diff --git a/plugins/python/sudo_python_module.c b/plugins/python/sudo_python_module.c index 2717c97db..2ba00e2bc 100644 --- a/plugins/python/sudo_python_module.c +++ b/plugins/python/sudo_python_module.c @@ -399,14 +399,14 @@ python_sudo_conversation(PyObject *Py_UNUSED(self), PyObject *py_args, PyObject if (py_ctx.sudo_conv == NULL) { PyErr_Format(sudo_exc_SudoException, "%s: conversation is unavailable", - __PRETTY_FUNCTION__); + __func__); goto cleanup; } int rc = py_sudo_conv((int)num_msgs, msgs, replies, &callback); if (rc != 0) { PyErr_Format(sudo_exc_ConversationInterrupted, - "%s: conversation was interrupted", __PRETTY_FUNCTION__, rc); + "%s: conversation was interrupted", __func__, rc); goto cleanup; } @@ -419,7 +419,7 @@ python_sudo_conversation(PyObject *Py_UNUSED(self), PyObject *py_args, PyObject } if (PyTuple_SetItem(py_result, i, py_reply) != 0) { // this steals a reference even on error - PyErr_Format(sudo_exc_SudoException, "%s: failed to set tuple item", __PRETTY_FUNCTION__); + PyErr_Format(sudo_exc_SudoException, "%s: failed to set tuple item", __func__); goto cleanup; }