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
104104 puts("output file ok");
105105 }
106106
107−int mp_mkostemps(char *template, int suffixlen, int flags);
108−
109107 int main(int argc, char *argv[])
110108 {
111109 atexit(exit_cleanup);
@@ -115,9 +113,17 @@ int main(int argc, char *argv[]) · 3 unmodified lines
115113 return 1;
116114
117115 static char path[] = "./testout.XXXXXX";
118− out_path = mktemp(path);
116+
117+#ifdef _WIN32
118+ out_path = _mktemp(path);
119119 if (!out_path || !*out_path)
120120 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
121127
122128 check_api_error(mpv_set_option_string(ctx, "o", out_path));
123129 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