Skip to content

Commit 6c1f27e

Browse files
committed
Fix return types and values
!= 0 means true, not false.
1 parent 20d4e5d commit 6c1f27e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/binfmt-bypass/elf.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ ssize_t get_pt_dynamic_offset(std::ifstream& ifs)
138138
bool is_32bit_elf(std::ifstream& ifs) {
139139
if (!ifs) {
140140
log_error("failed to read e_ident from ELF file\n");
141-
return -1;
141+
return false;
142142
}
143143

144144
// for the beginning, we just need to read e_ident to determine ELF class (i.e., either 32-bit or 64-bit)
@@ -165,7 +165,7 @@ bool is_32bit_elf(const std::string& filename) {
165165

166166
if (!ifs) {
167167
log_error("could not open file: %s\n", filename.c_str());
168-
return -1;
168+
return false;
169169
}
170170

171171
return is_32bit_elf(ifs);
@@ -174,7 +174,7 @@ bool is_32bit_elf(const std::string& filename) {
174174
bool is_statically_linked_elf(std::ifstream& ifs) {
175175
if (!ifs) {
176176
log_error("failed to read e_ident from ELF file\n");
177-
return -1;
177+
return false;
178178
}
179179

180180
ssize_t pt_dynamic_offset;
@@ -193,7 +193,7 @@ bool is_statically_linked_elf(const std::string& filename) {
193193

194194
if (!ifs) {
195195
log_error("could not open file: %s\n", filename.c_str());
196-
return -1;
196+
return false;
197197
}
198198

199199
return is_statically_linked_elf(ifs);

0 commit comments

Comments
 (0)