提交 590eaf01 编写于 作者: C cheng_jinsong

fix fstab linker

Signed-off-by: Ncheng_jinsong <chengjinsong2@huawei.com>
上级 5227241f
......@@ -78,11 +78,11 @@ static int AddToFstab(Fstab *fstab, FstabItem *item)
if (fstab == NULL || item == NULL) {
return -1;
}
if (fstab->head != NULL) {
item->next = fstab->head->next;
fstab->head->next = item;
if (fstab->tail == NULL) {
fstab->head = fstab->tail = item;
} else {
fstab->head = item;
fstab->tail->next = item;
fstab->tail = item;
}
return 0;
}
......@@ -123,6 +123,7 @@ void ReleaseFstab(Fstab *fstab)
ReleaseFstabItem(item);
item = tmp;
}
fstab->head = fstab->tail = NULL;
free(fstab);
fstab = NULL;
}
......
......@@ -59,6 +59,7 @@ typedef struct FstabItem {
typedef struct {
struct FstabItem *head;
struct FstabItem *tail;
} Fstab;
typedef enum SlotFlag {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册