1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-03 01:17:45 +03:00

tree-wide: use C99 __func__ rather than obsolete __FUNCTION__

We use __func__ almost everywhere, but there are some holdouts. Fix
that.
This commit is contained in:
Lennart Poettering 2021-10-11 13:50:29 +02:00
parent fe92eb795b
commit 7fbae5b706
6 changed files with 15 additions and 15 deletions

View File

@ -126,7 +126,7 @@ _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) {
DISABLE_WARNING_FORMAT_NONLITERAL;
log_internalv(LOG_AUTH | callback_type_to_priority(type),
0, PROJECT_FILE, __LINE__, __FUNCTION__,
0, PROJECT_FILE, __LINE__, __func__,
fmt2, ap);
REENABLE_WARNING;
va_end(ap);

View File

@ -45,7 +45,7 @@ static void test_request_basic(sd_event *e) {
sd_dhcp_client *client;
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
/* Initialize client without Anonymize settings. */
r = sd_dhcp_client_new(&client, false);
@ -105,7 +105,7 @@ static void test_request_anonymize(sd_event *e) {
sd_dhcp_client *client;
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
/* Initialize client with Anonymize settings. */
r = sd_dhcp_client_new(&client, true);
@ -137,7 +137,7 @@ static void test_checksum(void) {
};
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
assert_se(dhcp_packet_checksum((uint8_t*)&buf, 20) == be16toh(0x78ae));
}
@ -279,7 +279,7 @@ static void test_discover_message(sd_event *e) {
int res, r;
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
r = sd_dhcp_client_new(&client, false);
assert_se(r >= 0);
@ -497,7 +497,7 @@ static void test_addr_acq(sd_event *e) {
int res, r;
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
r = sd_dhcp_client_new(&client, false);
assert_se(r >= 0);

View File

@ -81,7 +81,7 @@ static void test_public_api_setters(sd_event *e) {
.ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}};
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
assert_se(sd_ipv4ll_new(&ll) == 0);
assert_se(ll);
@ -130,7 +130,7 @@ static void test_basic_request(sd_event *e) {
.ether_addr_octet = {'A', 'B', 'C', '1', '2', '3'}};
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
assert_se(sd_ipv4ll_new(&ll) == 0);
assert_se(sd_ipv4ll_start(ll) == -EINVAL);

View File

@ -111,7 +111,7 @@ static int test_rs_hangcheck(sd_event_source *s, uint64_t usec,
static void test_radv_prefix(void) {
sd_radv_prefix *p;
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
assert_se(sd_radv_prefix_new(&p) >= 0);
@ -153,7 +153,7 @@ static void test_radv_prefix(void) {
static void test_radv(void) {
sd_radv *ra;
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
assert_se(sd_radv_new(&ra) >= 0);
assert_se(ra);
@ -295,7 +295,7 @@ static void test_ra(void) {
sd_radv *ra;
unsigned i;
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
assert_se(socketpair(AF_UNIX, SOCK_SEQPACKET | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, test_fd) >= 0);

View File

@ -273,7 +273,7 @@ static void test_rs(void) {
sd_ndisc *nd;
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
send_ra_function = send_ra;
@ -366,7 +366,7 @@ static void test_timeout(void) {
sd_ndisc *nd;
if (verbose)
printf("* %s\n", __FUNCTION__);
printf("* %s\n", __func__);
send_ra_function = test_timeout_value;

View File

@ -237,7 +237,7 @@ static int scsi_dump(struct scsi_id_device *dev_scsi, struct sg_io_hdr *io) {
*/
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
"%s: called with no error",
__FUNCTION__);
__func__);
log_debug("%s: sg_io failed status 0x%x 0x%x 0x%x 0x%x",
dev_scsi->kernel, io->driver_status, io->host_status, io->msg_status, io->status);
@ -255,7 +255,7 @@ static int scsi_dump_v4(struct scsi_id_device *dev_scsi, struct sg_io_v4 *io) {
*/
return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
"%s: called with no error",
__FUNCTION__);
__func__);
log_debug("%s: sg_io failed status 0x%x 0x%x 0x%x",
dev_scsi->kernel, io->driver_status, io->transport_status, io->device_status);