History

test/libmpv_encode: avoid mktemp warning

Doesn't really matter but it's annoying so replace it with mkstemp instead. For windows, just use _mktemp.

Dudemanguy committed 2 years ago

Commit b402cc31 parent 8df4cb51 file · +9 −3Browse files

Unified · Split

test/libmpv_encode.c+9−3
@@ -104,8 +104,6 @@ static void check_output(FILE *fp) · 103 unmodified lines
104 puts("output file ok");104 puts("output file ok");
105}105}
106 106
107int mp_mkostemps(char *template, int suffixlen, int flags);
108
109int main(int argc, char *argv[])107int main(int argc, char *argv[])
110{108{
111 atexit(exit_cleanup);109 atexit(exit_cleanup);
@@ -115,9 +113,17 @@ int main(int argc, char *argv[]) · 3 unmodified lines
115 return 1;113 return 1;
116 114
117 static char path[] = "./testout.XXXXXX";115 static char path[] = "./testout.XXXXXX";
118 out_path = mktemp(path);116
117#ifdef _WIN32
118 out_path = _mktemp(path);
119 if (!out_path || !*out_path)119 if (!out_path || !*out_path)
120 fail("tmpfile failed\n");120 fail("tmpfile failed\n");
121#else
122 int fd = mkstemp(path);
123 if (fd == -1)
124 fail("tmpfile failed\n");
125 out_path = path;
126#endif
121 127
122 check_api_error(mpv_set_option_string(ctx, "o", out_path));128 check_api_error(mpv_set_option_string(ctx, "o", out_path));
123 check_api_error(mpv_set_option_string(ctx, "of", "matroska"));129 check_api_error(mpv_set_option_string(ctx, "of", "matroska"));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t