From: Tedd Ho-Jeong An Date: Mon, 18 Oct 2021 17:28:33 +0000 (-0700) Subject: peripheral: Fix unchecked return value X-Git-Tag: submit/tizen/20220313.220938~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d018bd7c1318b0191f1c4b9b6a939ad6c3a91cb;p=platform%2Fupstream%2Fbluez.git peripheral: Fix unchecked return value This patch fixes the unchecked return value(CWE-252) issues reported by the Coverity. Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- diff --git a/peripheral/main.c b/peripheral/main.c index e54ae213..45e103f8 100755 --- a/peripheral/main.c +++ b/peripheral/main.c @@ -76,7 +76,8 @@ static void prepare_filesystem(void) if (lstat(mount_table[i].target, &st) < 0) { printf("Creating %s\n", mount_table[i].target); - mkdir(mount_table[i].target, 0755); + if (mkdir(mount_table[i].target, 0755) < 0) + perror("Failed to create dir"); } printf("Mounting %s to %s\n", mount_table[i].fstype,