1.优化代码使用FileSys api
This commit is contained in:
		
							parent
							
								
									9fa3a0833d
								
							
						
					
					
						commit
						e400e93ea1
					
				| 
						 | 
				
			
			@ -2168,7 +2168,7 @@ void sf_file_thumb_cfg_sava(void)
 | 
			
		|||
        FST_FILE fs = 0;
 | 
			
		||||
        //char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0};
 | 
			
		||||
        //int fd = 0;
 | 
			
		||||
        static int flag = 0;
 | 
			
		||||
        //static int flag = 0;
 | 
			
		||||
        //struct stat st;
 | 
			
		||||
        #if SF_IQ_TEST != ENABLE
 | 
			
		||||
        INT32 uiStatus = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -2184,17 +2184,11 @@ void sf_file_thumb_cfg_sava(void)
 | 
			
		|||
        //printf("Add %s to send.List\n", sendfname);
 | 
			
		||||
        if(0 == puiPara->SendType){
 | 
			
		||||
            snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO);
 | 
			
		||||
            if((access(sendListName, F_OK) == 0) && (0 == flag))
 | 
			
		||||
            {
 | 
			
		||||
                printf("%s:%d DeleteFile:%s\r\n", __FUNCTION__, __LINE__, sendListName);
 | 
			
		||||
                if (FileSys_DeleteFile(sendListName) != FST_STA_OK) {
 | 
			
		||||
                    DBG_IND("Ignore deleting file.\r\n");
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            flag = 1;
 | 
			
		||||
            fs = FileSys_OpenFile(sendListName, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
 | 
			
		||||
 | 
			
		||||
        }else {
 | 
			
		||||
            snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST);
 | 
			
		||||
            fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        /*if(access(sendListName, F_OK) == 0)
 | 
			
		||||
| 
						 | 
				
			
			@ -2205,7 +2199,6 @@ void sf_file_thumb_cfg_sava(void)
 | 
			
		|||
        else {
 | 
			
		||||
            fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT);
 | 
			
		||||
        }*/
 | 
			
		||||
        fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
 | 
			
		||||
        if(/*fd*/fs)
 | 
			
		||||
        {
 | 
			
		||||
            FileSys_StatFile(fs, &FileStat);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user