Skip to content

Commit 2b4f573

Browse files
committed
bin/xbps-checkvers: remove usage of deprecated readdir_r
1 parent 333c399 commit 2b4f573

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

bin/xbps-checkvers/main.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -615,20 +615,15 @@ static int
615615
rcv_process_dir(rcv_t *rcv, rcv_proc_func process)
616616
{
617617
DIR *dir = NULL;
618-
struct dirent entry, *result;
618+
struct dirent *result;
619619
struct stat st;
620620
char filename[BUFSIZ];
621-
int i, ret = 0;
621+
int ret = 0;
622622

623623
if (!(dir = opendir(".")))
624624
goto error;
625625

626-
for (;;) {
627-
i = readdir_r(dir, &entry, &result);
628-
if (i > 0)
629-
goto error;
630-
if (result == NULL)
631-
break;
626+
while ((result = readdir(dir))) {
632627
if ((strcmp(result->d_name, ".") == 0) ||
633628
(strcmp(result->d_name, "..") == 0))
634629
continue;

0 commit comments

Comments
 (0)