libutil/libu2s: Move strlcpy() implementation to libutils

The strlcpy() implementation in libu2s is beneficial for other tools as
well. Move the implementation to libutils and replace misc_strlcpy() in
libu2s accordingly.

Change the link order in zipl to make it build again.

Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Jan Höppner
2018-11-07 14:20:40 +01:00
parent a208463e49
commit aefc8cd3ff
7 changed files with 35 additions and 49 deletions
+3 -3
View File
@@ -20,7 +20,7 @@
#include <wait.h>
#include "lib/u2s.h"
#include "misc.h"
#include "lib/util_libc.h"
#define DEV_BUFFER_LENGTH 20
#define PATH_BUFFER_LENGTH 256
@@ -113,7 +113,7 @@ static int extract_busid(char *name, char *busid) {
if (!start)
return -1;
start++;
len = misc_strlcpy(busid, start, BUSIDSIZE);
len = util_strlcpy(busid, start, BUSIDSIZE);
if (len >= BUSIDSIZE)
return -1;
@@ -246,7 +246,7 @@ static int find_busid_in_proc(int maja, int mina, char *busid)
while (fscanf(filp, "%[^(] %*[^)] ) at ( %d : %d %*[^\n]\n",
bus, &majb, &minb) != EOF) {
if ((maja == majb) && (mina == minb)) {
len = misc_strlcpy(busid, bus, BUSIDSIZE);
len = util_strlcpy(busid, bus, BUSIDSIZE);
if (len < BUSIDSIZE)
rc = 0;
break;