fix build warning (#2365)
* fix build warning * Update selfdrive/common/util.c Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>pull/2348/head
parent
c85b3de400
commit
0bbd080a04
|
@ -52,7 +52,7 @@ int write_file(const char* path, const void* data, size_t size) {
|
|||
}
|
||||
ssize_t n = write(fd, data, size);
|
||||
close(fd);
|
||||
return n == size ? 0 : -1;
|
||||
return (n >= 0 && (size_t)n == size) ? 0 : -1;
|
||||
}
|
||||
|
||||
void set_thread_name(const char* name) {
|
||||
|
|
Loading…
Reference in New Issue