Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From a2e3a2e332c406ea3c56a8d74b61978107df68e6 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 16 Jun 2017 22:23:08 -0700 |
| 4 | Subject: [PATCH 5/6] engine: Define SENTINEL |
| 5 | |
| 6 | Fix warnings with gcc7 |
| 7 | test.cpp:12: warning: missing sentinel in function call |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | --- |
| 13 | lib/engine/utils.cpp | 4 ++-- |
| 14 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 15 | |
| 16 | diff --git a/lib/engine/utils.cpp b/lib/engine/utils.cpp |
| 17 | index 44579a1..8812a8c 100644 |
| 18 | --- a/lib/engine/utils.cpp |
| 19 | +++ b/lib/engine/utils.cpp |
| 20 | @@ -35,7 +35,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 21 | #include "filesystem.h" |
| 22 | #include "utils.h" |
| 23 | #include "log/log.h" |
| 24 | - |
| 25 | +#define SENTINEL (const char *)0 |
| 26 | /** |
| 27 | * @brief capture shell output as binary data |
| 28 | * |
| 29 | @@ -139,7 +139,7 @@ int shell(const String &s) |
| 30 | * Before switching into new executable close all non standard |
| 31 | * file handlers.*/ |
| 32 | close_parent_fds(); |
| 33 | - execl("/bin/sh", "sh", "-c", cmd.get(), NULL); |
| 34 | + execl("/bin/sh", "sh", "-c", cmd.get(), SENTINEL); |
| 35 | /* If we're here then execl failed*/ |
| 36 | exit(-1); |
| 37 | break; |
| 38 | -- |
| 39 | 2.13.1 |
| 40 | |