| 27 | */ |
| 28 | |
| 29 | static my_bool cache_remove_open_tmp(IO_CACHE *cache __attribute__((unused)), |
| 30 | const char *name) |
| 31 | { |
| 32 | #if O_TEMPORARY == 0 |
| 33 | #if !defined(CANT_DELETE_OPEN_FILES) |
| 34 | /* The following should always succeed */ |
| 35 | (void) my_delete(name,MYF(MY_WME | ME_NOINPUT)); |
| 36 | #else |
| 37 | int length; |
| 38 | if (!(cache->file_name= |
| 39 | (char*) my_malloc((length=strlen(name)+1),MYF(MY_WME)))) |
| 40 | { |
| 41 | my_close(cache->file,MYF(0)); |
| 42 | cache->file = -1; |
| 43 | errno=my_errno=ENOMEM; |
| 44 | return 1; |
| 45 | } |
| 46 | memcpy(cache->file_name,name,length); |
| 47 | #endif |
| 48 | #endif /* O_TEMPORARY == 0 */ |
| 49 | return 0; |
| 50 | } |
| 51 | |
| 52 | /* |
| 53 | ** Open tempfile cached by IO_CACHE |
no test coverage detected