meta-agl-profile-telematics: recipes-core: systemd: change canbus systemd match regex
[AGL/meta-agl.git] / meta-agl-bsp / recipes-support / ptest-runner / ptest-runner / 0005-main.c-Use-realpath-to-get-the-actual-directory-of-p.patch
1 From 5bd94a93c89978c5e729db86b86b49919cd3b523 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linaro.org>
3 Date: Wed, 25 Apr 2018 12:05:29 -0500
4 Subject: [PATCH 5/7] main.c: Use realpath to get the actual directory of
5  ptests
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Fix usage of relative paths in -d argument.
11
12 $ ./ptest-runner -d ./tests/data
13
14 Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
15 ---
16  main.c | 3 ++-
17  1 file changed, 2 insertions(+), 1 deletion(-)
18
19 diff --git a/main.c b/main.c
20 index 505829cdad58..593aff1a1956 100644
21 --- a/main.c
22 +++ b/main.c
23 @@ -19,6 +19,7 @@
24   *     Aníbal Limón <anibal.limon@intel.com>
25   */
26  
27 +#include <limits.h>
28  #include <unistd.h>
29  #include <string.h>
30  #include <stdlib.h>
31 @@ -70,7 +71,7 @@ main(int argc, char *argv[])
32                 switch (opt) {
33                         case 'd':
34                                 free(opts.directory);
35 -                               opts.directory = strdup(optarg);
36 +                               opts.directory = realpath(optarg, NULL);
37                                 CHECK_ALLOCATION(opts.directory, 1, 1);
38                         break;
39                         case 'l':
40 -- 
41 2.11.0
42