diff options
| author | Mistivia <i@mistivia.com> | 2025-12-20 20:38:52 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-12-20 20:46:00 +0800 |
| commit | cfa6a4be3f357a7d223b602928b2fdf2abb6dda6 (patch) | |
| tree | e719d9bfdd24a6bb8fc1d7c61d812ef8877d5521 | |
| parent | ce1f847544cf5638085d02e3ebc5cb1dba062cd8 (diff) | |
clean tmp file when startup
| -rw-r--r-- | ezlive_config.c | 1 | ||||
| -rw-r--r-- | main.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ezlive_config.c b/ezlive_config.c index 618c051..34fb6e7 100644 --- a/ezlive_config.c +++ b/ezlive_config.c @@ -43,7 +43,6 @@ bool EZLiveConfig_load(EZLiveConfig *self, const char *filename) { FILE *fp = fopen(filename, "r"); if (!fp) { - perror("fopen"); return false; } @@ -77,7 +77,16 @@ void on_srt_data(void *ctx, char *buf, size_t size) { RingBuffer_write(rb, (const uint8_t*)buf, size); } +void cleantmpfile() { +#ifdef _WIN32 + system("del tmp*"); +#else + system("rm /tmp/ezlive*"); +#endif +} + int main(int argc, char **argv) { + cleantmpfile(); ezlive_config = malloc(sizeof(EZLiveConfig)); EZLiveConfig_init(ezlive_config); bool succ; |
