mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 19:25:02 +00:00
Fix more coverity warnings
Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: I82ece2de948ef224115c408bdfc09445d3da119b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/390337 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
fefc682bb7
commit
770202f0c7
@@ -747,20 +747,24 @@ int VbSetSystemPropertyString(const char* name, const char* value) {
|
||||
}
|
||||
|
||||
|
||||
static int InAndroid() {
|
||||
int fd;
|
||||
struct stat s;
|
||||
static int InAndroid(void)
|
||||
{
|
||||
int fd;
|
||||
struct stat s;
|
||||
int retval = 0;
|
||||
|
||||
/* In Android, mosys utility located in /system/bin
|
||||
check if file exists. Using fstat because for some
|
||||
reason, stat() was seg faulting in Android */
|
||||
fd = open(MOSYS_ANDROID_PATH, O_RDONLY);
|
||||
if (fd != -1 && fstat(fd, &s) == 0) {
|
||||
close(fd);
|
||||
return 1;
|
||||
}
|
||||
close(fd);
|
||||
return 0;
|
||||
/*
|
||||
* In Android, mosys utility located in /system/bin check if file
|
||||
* exists. Using fstat because for some reason, stat() was seg
|
||||
* faulting in Android
|
||||
*/
|
||||
fd = open(MOSYS_ANDROID_PATH, O_RDONLY);
|
||||
if (fd != -1) {
|
||||
if (fstat(fd, &s) == 0)
|
||||
retval = 1;
|
||||
close(fd);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user