Skip to content

Commit 812cc7f

Browse files
authored
Merge pull request #661 from smcv/Wshadow
utils: Avoid shadowing the names of global functions Reviewed-by: swick
2 parents 5dab8b8 + 73abd50 commit 812cc7f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

utils.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -451,15 +451,15 @@ write_to_fd (int fd,
451451

452452
/* Sets errno on error (!= 0), ENOSPC on short write */
453453
int
454-
write_file_at (int dirfd,
454+
write_file_at (int dfd,
455455
const char *path,
456456
const char *content)
457457
{
458458
int fd;
459459
bool res;
460460
int errsv;
461461

462-
fd = TEMP_FAILURE_RETRY (openat (dirfd, path, O_RDWR | O_CLOEXEC, 0));
462+
fd = TEMP_FAILURE_RETRY (openat (dfd, path, O_RDWR | O_CLOEXEC, 0));
463463
if (fd == -1)
464464
return -1;
465465

@@ -639,14 +639,14 @@ load_file_data (int fd,
639639
/* Sets errno on error (== NULL),
640640
* Always ensures terminating zero */
641641
char *
642-
load_file_at (int dirfd,
642+
load_file_at (int dfd,
643643
const char *path)
644644
{
645645
int fd;
646646
char *data;
647647
int errsv;
648648

649-
fd = TEMP_FAILURE_RETRY (openat (dirfd, path, O_CLOEXEC | O_RDONLY));
649+
fd = TEMP_FAILURE_RETRY (openat (dfd, path, O_CLOEXEC | O_RDONLY));
650650
if (fd == -1)
651651
return NULL;
652652

@@ -752,7 +752,7 @@ mkdir_with_parents (const char *pathname,
752752
read back with read_pid_from_socket(), and then the kernel has
753753
translated it between namespaces as needed. */
754754
void
755-
send_pid_on_socket (int socket)
755+
send_pid_on_socket (int sockfd)
756756
{
757757
char buf[1] = { 0 };
758758
struct msghdr msg = {};
@@ -777,7 +777,7 @@ send_pid_on_socket (int socket)
777777
cred->uid = geteuid ();
778778
cred->gid = getegid ();
779779

780-
if (TEMP_FAILURE_RETRY (sendmsg (socket, &msg, 0)) < 0)
780+
if (TEMP_FAILURE_RETRY (sendmsg (sockfd, &msg, 0)) < 0)
781781
die_with_error ("Can't send pid");
782782
}
783783

@@ -794,7 +794,7 @@ create_pid_socketpair (int sockets[2])
794794
}
795795

796796
int
797-
read_pid_from_socket (int socket)
797+
read_pid_from_socket (int sockfd)
798798
{
799799
char recv_buf[1] = { 0 };
800800
struct msghdr msg = {};
@@ -808,7 +808,7 @@ read_pid_from_socket (int socket)
808808
msg.msg_control = control_buf_rcv;
809809
msg.msg_controllen = control_len_rcv;
810810

811-
if (TEMP_FAILURE_RETRY (recvmsg (socket, &msg, 0)) < 0)
811+
if (TEMP_FAILURE_RETRY (recvmsg (sockfd, &msg, 0)) < 0)
812812
die_with_error ("Can't read pid from socket");
813813

814814
if (msg.msg_controllen <= 0)

0 commit comments

Comments
 (0)