X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_log_fat.c;h=62e97868e1f7e445cd4b63262ec9306343041a53;hb=97cf9df882291b9e494b2f64f84eb37357a6ab31;hp=af77401ce9ce4c052887c80fde329388ed3eadff;hpb=79d01a571935138b24b86a7181307ee014d248ed;p=fw%2Faltos diff --git a/src/drivers/ao_log_fat.c b/src/drivers/ao_log_fat.c index af77401c..62e97868 100644 --- a/src/drivers/ao_log_fat.c +++ b/src/drivers/ao_log_fat.c @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,7 +28,7 @@ static uint8_t log_mutex; static void ao_log_open(void) { - char name[12]; + static char name[12]; int8_t status; sprintf(name,"%04d%02d%02dLOG", 2000 + log_year, log_month, log_day); @@ -38,7 +39,7 @@ ao_log_open(void) log_open = 1; } else if (status == -AO_FAT_ENOENT) { status = ao_fat_creat(name); - if (status == AO_FAT_SUCCESS) { + if (status >= 0) { log_fd = status; log_open = 1; }