diff options
author | Tor Lillqvist <tml@iki.fi> | 2000-11-11 13:46:15 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2000-11-11 13:46:15 +0000 |
commit | 4f76917c6a239dfcecfd87682799953e27681be9 (patch) | |
tree | 507d30d65c94e7c4f0effc441452419b7abb3b46 /glib | |
parent | 40cfd305c27be0befc965564062bd874fb045926 (diff) | |
download | glib-4f76917c6a239dfcecfd87682799953e27681be9.tar.gz |
Improve chance to generate unique names with less effort a bit.
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gfileutils.c (g_mkstemp): Improve chance to generate unique
names with less effort a bit.
* gfileutils.h: Add g_file_open_tmp() declaration.
* testglib.c: Include <io.h> on Win32.
* makefile.mingw.in: Correct the way to invoke sub-makes.
2000-11-11 Tor Lillqvist <tml@iki.fi>
* gtypemodule.c: Include stdlib.h for exit().
* makefile.{mingw,msc}.in (gobject_OBJECTS): Add gtypemodule.
* gobject.def: Add new functions.
Diffstat (limited to 'glib')
-rw-r--r-- | glib/gfileutils.c | 3 | ||||
-rw-r--r-- | glib/gfileutils.h | 7 | ||||
-rw-r--r-- | glib/makefile.mingw.in | 13 |
3 files changed, 14 insertions, 9 deletions
diff --git a/glib/gfileutils.c b/glib/gfileutils.c index c8bb0a7cc..b897e1b0a 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -538,6 +538,7 @@ g_mkstemp (char *tmpl) static const int NLETTERS = sizeof (letters) - 1; glong value; GTimeVal tv; + static int counter = 0; len = strlen (tmpl); if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) @@ -548,7 +549,7 @@ g_mkstemp (char *tmpl) /* Get some more or less random data. */ g_get_current_time (&tv); - value = tv.tv_usec ^ tv.tv_sec; + value = (tv.tv_usec ^ tv.tv_sec) + counter++; for (count = 0; count < 100; value += 7777, ++count) { diff --git a/glib/gfileutils.h b/glib/gfileutils.h index dba134e84..0e80543c6 100644 --- a/glib/gfileutils.h +++ b/glib/gfileutils.h @@ -81,7 +81,12 @@ gboolean g_file_get_contents (const gchar *filename, /* Wrapper / workalike for mkstemp() */ -int g_mkstemp (char *tmpl); +int g_mkstemp (char *tmpl); + +/* Wrapper for g_mkstemp */ +int g_file_open_tmp (const char *template, + char **name_used, + GError **error); G_END_DECLS diff --git a/glib/makefile.mingw.in b/glib/makefile.mingw.in index 5e7c94853..2ae090ae4 100644 --- a/glib/makefile.mingw.in +++ b/glib/makefile.mingw.in @@ -24,10 +24,9 @@ DEPCFLAGS = $(LIBICONV_CFLAGS) DLLS_TO_BUILD = \ glib-$(GLIB_VER).dll \ - gmodule/gmodule-$(GLIB_VER).dll \ - gthread/gthread-$(GLIB_VER).dll \ - gobject/gobject-$(GLIB_VER).dll - + sub-gmodule \ + sub-gthread \ + sub-gobject all : \ config.h \ @@ -102,13 +101,13 @@ gspawn-win32-helper.exe : gspawn-win32.c ################ subdirectories -gmodule/gmodule-$(GLIB_VER).dll : glib-$(GLIB_VER).dll +sub-gmodule : cd gmodule && $(MAKE) -f makefile.mingw all -gthread/gthread-$(GLIB_VER).dll : glib-$(GLIB_VER).dll +sub-gthread : cd gthread && $(MAKE) -f makefile.mingw all -gobject/gobject-$(GLIB_VER).dll : glib-$(GLIB_VER).dll +sub-gobject : cd gobject && $(MAKE) -f makefile.mingw all ################ test progs |