After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705075 - Simplify g_get_tmp_dir()
Simplify g_get_tmp_dir()
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-07-29 13:47 UTC by Allison Karlitskaya (desrt)
Modified: 2013-08-04 15:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
g_get_tmp_dir(): Clean up envars (2.87 KB, patch)
2013-07-29 14:05 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2013-07-29 13:47:51 UTC
The docs say "This is found from inspecting the environment variables TMPDIR, TMP, and TEMP in that order."

I hate this crap.  It's a mess, and we're only contributing to it.  POSIX is quite clear that the only variable that we should be looking at here is TMPDIR, so let's just do that.
Comment 1 Allison Karlitskaya (desrt) 2013-07-29 13:51:41 UTC
Oh... of course, on Windows, it's supposed to be %TEMP%, but we should limit this to Windows.
Comment 2 Allison Karlitskaya (desrt) 2013-07-29 14:05:44 UTC
Created attachment 250371 [details] [review]
g_get_tmp_dir(): Clean up envars

On UNIX, we should only ever be looking at TMPDIR.

On Windows, we should only ever look at TEMP.

Also, clean up the documentation to better describe what is actually
happening.  The previous docs may have left someone confused about why
this function returns "/var/tmp" on Solaris, even with no TMPDIR set.
Comment 3 Allison Karlitskaya (desrt) 2013-07-29 14:07:09 UTC
There may be an issue here with cygwin, if they would prefer we use TMPDIR.  I always forget G_OS_WIN32 vs. G_PLATFORM_WIN32....
Comment 4 Dan Winship 2013-07-30 12:27:17 UTC
Comment on attachment 250371 [details] [review]
g_get_tmp_dir(): Clean up envars

The unix bits look fine. No clue if the windows part is right or not.
Comment 5 Matthias Clasen 2013-08-04 15:06:38 UTC
Looks good to me too
Comment 6 Allison Karlitskaya (desrt) 2013-08-04 15:29:33 UTC
Talked to Dieter and discovered that G_OS_UNIX is defined on cygwin, so this will be fine.
Comment 7 Allison Karlitskaya (desrt) 2013-08-04 15:29:50 UTC
Attachment 250371 [details] pushed as c235240 - g_get_tmp_dir(): Clean up envars