When get_available_ptests uses realpath to support symlinks, this is
expected to not fail because usage of stack memory, if fails prints the
error and exit.

Signed-off-by: Anibal Limon <ani...@limonsoftware.com>
---
 utils.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/utils.c b/utils.c
index 59b8b77..54394cc 100644
--- a/utils.c
+++ b/utils.c
@@ -118,7 +118,10 @@ get_available_ptests(const char *dir)
        int saved_errno = -1; /* Initalize to invalid errno. */
        char realdir[PATH_MAX];
 
-       realpath(dir, realdir);
+       if (realpath(dir, realdir) == NULL) {
+               fprintf(stderr, "ERROR: get_available_ptests failed to get 
realpath, %s\n", strerror(errno));
+               exit(1);
+       }
 
        do
        {
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#62310): https://lists.yoctoproject.org/g/yocto/message/62310
Mute This Topic: https://lists.yoctoproject.org/mt/104001080/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to