Compare commits

..

3 Commits

Author SHA1 Message Date
Paul Beckingham
d216d40121 - Now points to 1.0.1 2008-06-04 21:22:45 -04:00
Paul Beckingham
08f4ead97e - Fixed bug whereby the UUID generated by the custom generator was not terminated.
- Fixed bug whereby random numbers were used by the custom UUID generator, but srandom/srand was not called first.
2008-06-04 21:00:23 -04:00
Paul Beckingham
f3de5c0711 - Added bare-bones task.html to point to the latest version. 2008-06-04 19:26:35 -04:00
5 changed files with 30 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
Principal Author
Principal Author:
Paul Beckingham, paul@beckingham.net
Contributing Authors
With thanks to:
Eugene Kramer
SK

View File

@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(task, 1.0.0, bugs@beckingham.net)
AC_INIT(task, 1.0.1, bugs@beckingham.net)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/task.cpp])
AC_CONFIG_HEADER([auto.h])
@@ -35,6 +35,8 @@ AC_FUNC_SELECT_ARGTYPES
AC_CHECK_FUNCS([select])
AC_CHECK_FUNC(flock, [AC_DEFINE([HAVE_FLOCK], [1], [Found flock])])
AC_CHECK_FUNC(uuid_unparse_lower, [AC_DEFINE([HAVE_UUID], [1], [Found uuid_unparse_lower])])
AC_CHECK_FUNC(random, [AC_DEFINE([HAVE_RANDOM], [1], [Found random])])
AC_CHECK_FUNC(srandom, [AC_DEFINE([HAVE_SRANDOM], [1], [Found srandom])])
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT

View File

@@ -207,6 +207,13 @@ int main (int argc, char** argv)
// TODO Find out what this is, and either promote it to live code, or remove it.
// std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
// Set up randomness.
#ifdef HAVE_SRANDOM
srandom (time (NULL));
#else
srand (time (NULL));
#endif
try
{
// Load the config file from the home directory. If the file cannot be

View File

@@ -182,14 +182,18 @@ const std::string uuid ()
static char randomHexDigit ()
{
static char digits[] = "0123456789abcdef";
#ifdef HAVE_RANDOM
return digits[random () % 16];
#else
return digits[rand () % 16];
#endif
}
////////////////////////////////////////////////////////////////////////////////
const std::string uuid ()
{
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
char id [37];
char id [48] = {0};
id[0] = randomHexDigit ();
id[1] = randomHexDigit ();
id[2] = randomHexDigit ();

11
task.html Normal file
View File

@@ -0,0 +1,11 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Task</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
Download the latest task source code <a href="http://www.beckingham.net/task-1.0.1.tar.gz">task-1.0.1.tar.gz</a> (6/4/2008).
<body>
</html>