告警整改

Signed-off-by: negegne <zhengshunxin@huawei.com>
This commit is contained in:
negegne
2024-04-26 17:47:33 +08:00
parent 43c08804e4
commit a8e2bf8cba
3 changed files with 13 additions and 15 deletions
-2
View File
@@ -46,7 +46,6 @@ boolean InitHiviewFile(HiviewFile *fp, HiviewFileType type, uint32 size)
fp->fhandle = HIVIEW_FileOpen(fp->path);
if (fp->fhandle < 0) {
int32 errnoRecord = (int32)errno;
HILOG_ERROR(HILOG_MODULE_HIVIEW, "HIVIEW_FileOpen failed type %d, errno %d", (int32)type, errnoRecord);
uint16 hieventID = 1;
HiEvent *hievent = HIEVENT_CREATE(HIEVENT_FAULT, hieventID, 2); // 2 params
HIEVENT_PUT_INT_VALUE(hievent, 0, (int32)type);
@@ -84,7 +83,6 @@ boolean InitHiviewFile(HiviewFile *fp, HiviewFileType type, uint32 size)
pHeader->rCursor = sizeof(HiviewFileHeader);
pHeader->wCursor = sizeof(HiviewFileHeader);
if (WriteFileHeader(fp) == FALSE) {
HILOG_ERROR(HILOG_MODULE_HIVIEW, "WriteFileHeader failed type %d, errno %d", (int32)type, (int32)errno);
return FALSE;
}
} else {
+1 -1
View File
@@ -190,7 +190,7 @@ void RegisterFileWatcher(HiviewFile *fp, FileProc func, const char *path);
*
* @param fp the pointer of file object.
* @param func callback function.
*
*
**/
void UnRegisterFileWatcher(HiviewFile *fp, FileProc func);
+12 -12
View File
@@ -150,13 +150,13 @@ void HIVIEW_InitHook(HIVIEW_Hooks *hooks)
return;
}
hiview_open = (hooks->open_fn) == NULL ? open : hooks->open_fn;
hiview_close = (hooks->close_fn) == NULL ? close : hooks->close_fn;;
hiview_read = (hooks->read_fn) == NULL ? read : hooks->read_fn;;
hiview_write = (hooks->write_fn) == NULL ? write : hooks->write_fn;;
hiview_lseek = (hooks->lseek_fn) == NULL ? lseek : hooks->lseek_fn;;
hiview_fsync = (hooks->fsync_fn) == NULL ? fsync : hooks->fsync_fn;;
hiview_unlink = (hooks->unlink_fn) == NULL ? unlink : hooks->unlink_fn;;
hiview_rename = (hooks->rename_fn) == NULL ? rename : hooks->rename_fn;;
hiview_close = (hooks->close_fn) == NULL ? close : hooks->close_fn;
hiview_read = (hooks->read_fn) == NULL ? read : hooks->read_fn;
hiview_write = (hooks->write_fn) == NULL ? write : hooks->write_fn;
hiview_lseek = (hooks->lseek_fn) == NULL ? lseek : hooks->lseek_fn;
hiview_fsync = (hooks->fsync_fn) == NULL ? fsync : hooks->fsync_fn;
hiview_unlink = (hooks->unlink_fn) == NULL ? unlink : hooks->unlink_fn;
hiview_rename = (hooks->rename_fn) == NULL ? rename : hooks->rename_fn;
}
int32 HIVIEW_FileOpen(const char *path)
@@ -294,10 +294,10 @@ uint8 HIVIEW_WdgResetFlag()
uint32 Change32Endian(uint32 num)
{
unsigned char *buffer = (unsigned char *)&num;
uint32 newEndian = (buffer[3] & 0xFF);
newEndian |= ((buffer[2] << 8) & 0xFF00);
newEndian |= ((buffer[1] << 16) & 0xFF0000);
newEndian |= ((buffer[0] << 24) & 0xFF000000);
uint32 newEndian = (buffer[3] & 0xFF); // 3: forth char
newEndian |= ((buffer[2] << 8) & 0xFF00); // 2: third char, 8: 1 byte length
newEndian |= ((buffer[1] << 16) & 0xFF0000); // 16: 2 byte length
newEndian |= ((buffer[0] << 24) & 0xFF000000); // 24: 3 byte length
return newEndian;
}
@@ -305,6 +305,6 @@ uint16 Change16Endian(uint16 num)
{
unsigned char* buffer = (unsigned char*)&num;
uint16 newEndian = (buffer[1] & 0xFF);
newEndian |= ((buffer[0] << 8) & 0xFF00);
newEndian |= ((buffer[0] << 8) & 0xFF00); // 8: 1 byte length
return newEndian;
}