diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-11-17 04:39:44 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-11-17 04:39:44 +0000 |
commit | eee9b9ddd30be0b11593a31ecf67672522d7e5ed (patch) | |
tree | a192462f2b3ff017b879d449c007c6d496a7046a /wsutil/tempfile.c | |
parent | 74647a318b93d780cae2eabe70ce45b55e4e94a7 (diff) |
Move get_tempfile_path() from filesystem.[ch] to tempfile.[ch].
svn path=/trunk/; revision=53379
Diffstat (limited to 'wsutil/tempfile.c')
-rw-r--r-- | wsutil/tempfile.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c index 2fab0df257..9993a0ea4f 100644 --- a/wsutil/tempfile.c +++ b/wsutil/tempfile.c @@ -146,6 +146,15 @@ mkdtemp (char *template) #endif /* HAVE_MKDTEMP */ +/* + * Construct and return the path name of a file in the + * appropriate temporary file directory. + */ +char *get_tempfile_path(const char *filename) +{ + return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename); +} + #define MAX_TEMPFILES 3 /** @@ -200,9 +209,6 @@ create_tempfile(char **namebuf, const char *pfx) tf[idx].path = (char *)g_malloc(tf[idx].len); } - /* - * We can't use get_tempfile_path here because we're called from dumpcap.c. - */ tmp_dir = g_get_tmp_dir(); #ifdef _WIN32 |