From 487a96f66322d04103f6a8504454ee905d034229 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Sun, 5 Jun 2022 22:30:34 +0100 Subject: [PATCH] gpt-utils: drop unused function it also called strlcpy which only exists on musl and bionic, dropping it lets this build on glibc too. --- gpt-utils.cpp | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/gpt-utils.cpp b/gpt-utils.cpp index d16dc61..a06eb7f 100644 --- a/gpt-utils.cpp +++ b/gpt-utils.cpp @@ -309,47 +309,6 @@ error: return -1; } -int add_lun_to_update_list(char *lun_path, struct update_data *dat) -{ - uint32_t i = 0; - struct stat st; - if (!lun_path || !dat) { - fprintf(stderr, "%s: Invalid data\n", __func__); - return -1; - } - if (stat(lun_path, &st)) { - fprintf(stderr, - "%s: Unable to access %s. Skipping adding to list\n", - __func__, lun_path); - return -1; - } - if (dat->num_valid_entries == 0) { - fprintf(stderr, "%s: Copying %s into lun_list[%d]\n", __func__, - lun_path, i); - strlcpy(dat->lun_list[0], lun_path, PATH_MAX * sizeof(char)); - dat->num_valid_entries = 1; - } else { - for (i = 0; (i < dat->num_valid_entries) && - (dat->num_valid_entries < MAX_LUNS - 1); - i++) { - //Check if the current LUN is not already part - //of the lun list - if (!strncmp(lun_path, dat->lun_list[i], - strlen(dat->lun_list[i]))) { - //LUN already in list..Return - return 0; - } - } - fprintf(stderr, "%s: Copying %s into lun_list[%d]\n", __func__, - lun_path, dat->num_valid_entries); - //Add LUN path lun list - strlcpy(dat->lun_list[dat->num_valid_entries], lun_path, - PATH_MAX * sizeof(char)); - dat->num_valid_entries++; - } - return 0; -} - //Given a parttion name(eg: rpm) get the path to the block device that //represents the GPT disk the partition resides on. In the case of emmc it //would be the default emmc dev(/dev/mmcblk0). In the case of UFS we look