summaryrefslogtreecommitdiff
path: root/wsutil/tempfile.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-11-17 04:39:44 +0000
committerGuy Harris <guy@alum.mit.edu>2013-11-17 04:39:44 +0000
commiteee9b9ddd30be0b11593a31ecf67672522d7e5ed (patch)
treea192462f2b3ff017b879d449c007c6d496a7046a /wsutil/tempfile.c
parent74647a318b93d780cae2eabe70ce45b55e4e94a7 (diff)
downloadwireshark-eee9b9ddd30be0b11593a31ecf67672522d7e5ed.tar.gz
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.c12
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