diff -ur orig/gnunet-0.6.6b/config.h.in gnunet-0.6.6b/config.h.in --- orig/gnunet-0.6.6b/config.h.in 2005-02-28 04:12:28.000000000 +0100 +++ gnunet-0.6.6b/config.h.in 2005-06-09 21:48:02.000000000 +0200 @@ -18,6 +18,9 @@ /* This is a FreeBSD system */ #undef FREEBSD +/* This is a GNU system */ +#undef GNU + /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND diff -ur orig/gnunet-0.6.6b/configure gnunet-0.6.6b/configure --- orig/gnunet-0.6.6b/configure 2005-02-28 04:05:46.000000000 +0100 +++ gnunet-0.6.6b/configure 2005-06-09 21:44:15.000000000 +0200 @@ -22397,6 +22397,13 @@ _ACEOF ;; +gnu*) + +cat >>confdefs.h <<_ACEOF +#define GNU 1 +_ACEOF + + ;; freebsd*) cat >>confdefs.h <<_ACEOF diff -ur orig/gnunet-0.6.6b/configure.ac gnunet-0.6.6b/configure.ac --- orig/gnunet-0.6.6b/configure.ac 2005-02-28 04:03:38.000000000 +0100 +++ gnunet-0.6.6b/configure.ac 2005-06-09 21:42:45.000000000 +0200 @@ -71,6 +71,9 @@ linux*) AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system]) ;; +gnu*) + AC_DEFINE_UNQUOTED(GNU,1,[This is a GNU system]) + ;; freebsd*) AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system]) AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system]) diff -ur orig/gnunet-0.6.6b/src/applications/testbed/gnunet-testbed.c gnunet-0.6.6b/src/applications/testbed/gnunet-testbed.c --- orig/gnunet-0.6.6b/src/applications/testbed/gnunet-testbed.c 2005-01-26 02:58:54.000000000 +0100 +++ gnunet-0.6.6b/src/applications/testbed/gnunet-testbed.c 2005-06-09 23:30:08.000000000 +0200 @@ -225,12 +225,21 @@ * A child (the shell) has quit. So we exit, * too. */ + +#ifdef GNU /* We don't support SA_SIGINFO yet on GNU/hurd */ +static void sigChildHandler(int signal) { + do_quit = YES; +} + +#else static void sigChildHandler(int signal, siginfo_t * info, void * extra) { do_quit = YES; } +#endif + /** * This is the "bash" process. Execs bash. * @returns never @@ -356,9 +365,17 @@ do_quit = NO; /* signal handler is needed if the child did exit (e.g. with CTRL-D and not with the command 'exit') */ - newAct.sa_sigaction = &sigChildHandler; + sigfillset(&newAct.sa_mask); + +#ifdef GNU /* We don't support SA_SIGINFO yet on GNU/Hurd */ + newAct.sa_flags = SA_NOCLDSTOP | SA_RESTART; + newAct.sa_handler = &sigChildHandler; +#else + newAct.sa_sigaction = &sigChildHandler; newAct.sa_flags = SA_NOCLDSTOP | SA_SIGINFO | SA_RESTART; +#endif + if (0 != sigaction(SIGCHLD, &newAct, &oldAct)) diff -ur orig/gnunet-0.6.6b/src/conf/conf.c gnunet-0.6.6b/src/conf/conf.c --- orig/gnunet-0.6.6b/src/conf/conf.c 2005-01-26 02:58:50.000000000 +0100 +++ gnunet-0.6.6b/src/conf/conf.c 2005-06-09 22:54:26.000000000 +0200 @@ -541,8 +541,10 @@ printf("***\n" "*** Can't find default configuration \"%s\"!\n" "***\n", defconfig_file); + free(defconfig_file); exit(1); } + free(defconfig_file); break; case ask_silent: if (STAT("/etc/GNUnet/.config", &tmpstat)) { diff -ur orig/gnunet-0.6.6b/src/conf/confdata.c gnunet-0.6.6b/src/conf/confdata.c --- orig/gnunet-0.6.6b/src/conf/confdata.c 2005-01-26 02:58:50.000000000 +0100 +++ gnunet-0.6.6b/src/conf/confdata.c 2005-06-09 23:01:23.000000000 +0200 @@ -60,16 +60,27 @@ return res_value; } +#define CHK_SIZE 255 + char *conf_get_default_confname(void) { + int nb, pass=1; struct stat buf; - static char fullname[PATH_MAX+1]; + char *fullname=NULL; char *env, *name; name = conf_expand_value(conf_defname); env = getenv(SRCTREE); if (env) { - sprintf(fullname, "%s/%s", env, name); + do + { + fullname = realloc(fullname, (CHK_SIZE * pass) * sizeof(char)); + nb = snprintf(fullname, (CHK_SIZE * pass), "%s/%s", env, name); + pass++; + + } + while ( nb > (CHK_SIZE * pass) ); + if (!STAT(fullname, &buf)) return fullname; } diff -ur orig/gnunet-0.6.6b/src/conf/lex.zconf.c gnunet-0.6.6b/src/conf/lex.zconf.c --- orig/gnunet-0.6.6b/src/conf/lex.zconf.c 2005-01-26 02:58:50.000000000 +0100 +++ gnunet-0.6.6b/src/conf/lex.zconf.c 2005-06-09 23:02:35.000000000 +0200 @@ -3593,17 +3593,31 @@ * when compiling the kernel. * Return NULL if file is not found. */ + +#define CHK_SIZE 255 + FILE *zconf_fopen(const char *name) { - char *env, fullname[PATH_MAX+1]; + int nb, pass=1; + char *env, *fullname=NULL; FILE *f; f = FOPEN(name, "r"); if (!f && name[0] != DIR_SEPARATOR) { env = getenv(SRCTREE); if (env) { - sprintf(fullname, "%s/%s", env, name); - f = FOPEN(fullname, "r"); + + do + { + fullname = realloc(fullname, (CHK_SIZE * pass) * sizeof(char)); + nb = snprintf(fullname, (CHK_SIZE * pass), "%s/%s", env, name); + pass++; + } + while ( nb > (CHK_SIZE * pass) ); + + f = FOPEN(fullname, "r"); + + free(fullname); } } return f; diff -ur orig/gnunet-0.6.6b/src/conf/mconf.c gnunet-0.6.6b/src/conf/mconf.c --- orig/gnunet-0.6.6b/src/conf/mconf.c 2005-01-26 02:58:50.000000000 +0100 +++ gnunet-0.6.6b/src/conf/mconf.c 2005-06-09 22:59:17.000000000 +0200 @@ -234,7 +234,7 @@ ; -static char filename[PATH_MAX+1] = "/etc/GNUnet/.config"; +static char *filename = "/etc/GNUnet/.config"; static int indent; static struct termios ios_org; static int rows, cols; diff -ur orig/gnunet-0.6.6b/src/util/storage.c gnunet-0.6.6b/src/util/storage.c --- orig/gnunet-0.6.6b/src/util/storage.c 2005-02-26 21:47:05.000000000 +0100 +++ gnunet-0.6.6b/src/util/storage.c 2005-06-09 22:22:20.000000000 +0200 @@ -30,6 +30,9 @@ #if LINUX || CYGWIN #include #else +#ifdef GNU +#include +#else #ifdef SOMEBSD #include #include @@ -53,6 +56,7 @@ #endif #endif #endif +#endif #ifndef SOMEBSD #ifndef WINDOWS @@ -169,6 +173,15 @@ LOG_STRERROR(LOG_ERROR, "statfs"); return -1; } +#elif GNU + struct statvfs buf; + + if (0 == statvfs(part, &buf)) { + return buf.f_bavail; + } else { + LOG_STRERROR(LOG_ERROR, "statfs"); + return -1; + } #elif MINGW DWORD dwDummy, dwBlocks; char szDrive[4];