Commit 4d312ccb authored by Yakubov, Sergey's avatar Yakubov, Sergey
Browse files

fix command exit code

parent 3b376dd3
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ SET(CPACK_RPM_PACKAGE_MAINTAINER "ORNL")

set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "2")
set(CPACK_PACKAGE_VERSION_PATCH "0")
set(CPACK_PACKAGE_VERSION_PATCH "1")

set(CPACK_DEBIAN_PACKAGE_DEPENDS "curl")
set(CPACK_RPM_PACKAGE_DEPENDS "curl")
+6 −6
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ int main(int argc, char *argv[]) {
        exit(1);
    }
    if (strcmp(argv[3], "-c") == 0) {
        return system(argv[4]);
        int res = system(argv[4]);
        exit(res == 0 ? 0 : 1);
    } else if (strcmp(argv[3], "-f") == 0) {
        int fd = open(argv[4], O_RDONLY);
        if (fd == -1) {
@@ -54,8 +55,7 @@ int main(int argc, char *argv[]) {

        char buf[1024];
        int buflen;
        while((buflen = read(fd, buf, 1024)) > 0)
        {
        while ((buflen = read(fd, buf, 1024)) > 0) {
            write(1, buf, buflen);
        }
        close(fd);