Skip to content

Commit

Permalink
fix two bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoqiansong committed Sep 11, 2019
1 parent 052a23d commit 28e2631
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions oui-io-util/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ md5sum(const char *file)

default:
memset(chksum, 0, sizeof(chksum));
read(fds[0], chksum, 32);
if (read(fds[0], chksum, 32) < 0)
return NULL;
waitpid(pid, NULL, 0);
close(fds[0]);
close(fds[1]);
Expand Down Expand Up @@ -610,7 +611,8 @@ main_backup(int argc, char **argv)
close(fds[0]);
close(fds[1]);

chdir("/");
if (chdir("/") < 0)
return failure(errno, "Failed to change dir");

execl("/sbin/sysupgrade", "/sbin/sysupgrade",
"--create-backup", "-", NULL);
Expand Down
1 change: 1 addition & 0 deletions oui-rpc-core/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ project(oui C)
add_definitions(-O -Wall -Werror --std=gnu99 -D_GNU_SOURCE)

add_library(oui MODULE oui.c)
target_link_libraries(oui crypt)
set_target_properties(oui PROPERTIES OUTPUT_NAME oui PREFIX "")

install(TARGETS oui
Expand Down

0 comments on commit 28e2631

Please sign in to comment.