block.c (985a03b0ce38275c2ea355bf29b6d6b5779dbb56) | block.c (0badc1ee0e6ab8622b2f9b4ebc3c5ab96f0b58d0) |
---|---|
1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 177 unchanged lines hidden (view full) --- 186 187 GetTempPath(MAX_PATH, temp_dir); 188 GetTempFileName(temp_dir, "qem", 0, filename); 189} 190#else 191void get_tmp_filename(char *filename, int size) 192{ 193 int fd; | 1/* 2 * QEMU System Emulator block driver 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 177 unchanged lines hidden (view full) --- 186 187 GetTempPath(MAX_PATH, temp_dir); 188 GetTempFileName(temp_dir, "qem", 0, filename); 189} 190#else 191void get_tmp_filename(char *filename, int size) 192{ 193 int fd; |
194 char *tmpdir; |
|
194 /* XXX: race condition possible */ | 195 /* XXX: race condition possible */ |
195 pstrcpy(filename, size, "/tmp/vl.XXXXXX"); | 196 tmpdir = getenv("TMPDIR"); 197 if (!tmpdir) 198 tmpdir = "/tmp"; 199 snprintf(filename, size, "%s/vl.XXXXXX", tmpdir); |
196 fd = mkstemp(filename); 197 close(fd); 198} 199#endif 200 201#ifdef _WIN32 202static int is_windows_drive_prefix(const char *filename) 203{ --- 1209 unchanged lines hidden --- | 200 fd = mkstemp(filename); 201 close(fd); 202} 203#endif 204 205#ifdef _WIN32 206static int is_windows_drive_prefix(const char *filename) 207{ --- 1209 unchanged lines hidden --- |