From 854c6f9779ee41bc6b3e895b4dbf30a5d13e0b88 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Mon, 7 Nov 2016 17:57:00 +0800 Subject: [PATCH] Fix build with clang --- src/acl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/acl.c b/src/acl.c index b7a521a3..d5479eea 100644 --- a/src/acl.c +++ b/src/acl.c @@ -53,16 +53,18 @@ static int run_cmd(const char *cmdstring) { pid_t pid; - int status; - if (cmdstring == NULL) { - return 1; - } + int status = 0; + + if (cmdstring == NULL) + return -1; + if ((pid = fork()) < 0) { status = -1; } else if (pid == 0) { execl("/bin/sh", "sh", "-c", cmdstring, (char *)0); _exit(127); } + return status; }