power: disable_coredump_handler: Fix error condition correctly 28/193928/1 accepted/tizen/unified/20181205.063355 submit/tizen/20181204.070128
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 27 Nov 2018 13:16:33 +0000 (14:16 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 27 Nov 2018 13:16:33 +0000 (14:16 +0100)
fd could be zero as well and it's not an error condition.  Fix
the check to only test write() return value.

Change-Id: I92932f7fa2368d88fc2210f35f35521ba51161c2

src/power/power-handler.c

index d45267b..d277641 100755 (executable)
@@ -167,7 +167,7 @@ static bool disable_coredump_handler(void)
                close(fd);
        }
 
-       bool is_ok = fd > 0 && ret > 0;
+       bool is_ok = ret > 0;
        _I("Disabling core dumps %s", is_ok  ? "succeeded" : "failed");
 
        return is_ok;