[Git][cmucl/cmucl][master] 2 commits: Fix an incorrect error check detected by the GCC analyzer
Carl Shapiro pushed to branch master at cmucl / cmucl Commits: 57c9f9b7 by Carl Shapiro at 2024-04-25T12:30:13-07:00 Fix an incorrect error check detected by the GCC analyzer The return value of open(2) should be compared with -1 to check for an error but it was compared with 0 instead. - - - - - 99abb703 by Carl Shapiro at 2024-04-26T01:53:53+00:00 Merge branch 'open-error' into 'master' Fix an incorrect error check detected by the GCC analyzer See merge request cmucl/cmucl!211 - - - - - 1 changed file: - src/lisp/elf.c Changes: ===================================== src/lisp/elf.c ===================================== @@ -442,7 +442,7 @@ map_core_sections(const char *exec_name) image_static_space_size, image_read_only_space_size; - if (!(exec_fd = open(exec_name, O_RDONLY))) { + if ((exec_fd = open(exec_name, O_RDONLY)) == -1) { perror("Can't open executable!"); exit(-1); } View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/7c91087e17dd1145e04843e... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/7c91087e17dd1145e04843e... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Carl Shapiro (@cshapiro)