Skip to content

Instantly share code, notes, and snippets.

@mattn
Created March 6, 2014 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/9383016 to your computer and use it in GitHub Desktop.
Save mattn/9383016 to your computer and use it in GitHub Desktop.
diff --git a/src/itdb_sqlite.c b/src/itdb_sqlite.c
index b5b2975..2628c60 100644
--- a/src/itdb_sqlite.c
+++ b/src/itdb_sqlite.c
@@ -2278,11 +2278,8 @@ int itdb_sqlite_generate_itdbs(FExport *fexp)
tzoffset = fexp->itdb->tzoffset;
- tmpdir = g_build_path(g_get_tmp_dir(), tmpnam(NULL), NULL);
- if (g_mkdir(tmpdir, 0755) != 0) {
- g_set_error (&fexp->error, G_FILE_ERROR, g_file_error_from_errno(errno),
- "Could not create temporary directory '%s': %s",
- tmpdir, strerror(errno));
+ tmpdir = g_dir_make_tmp("libgpod.XXXXXX", &fexp->error);
+ if (!tmpdir) {
res = -1;
goto leave;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment