X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=rset%2Frstemp.c;h=505e38ec5d9f642fbdd109570796de8ad59c7ddf;hb=3731bdaf94aeba2550fc553aebe34831c203dc36;hp=709dd99f8e052810ee606b1b0ba499329a9c9669;hpb=0f78f3fe78e859d9f0d3f0d3e13fcd28085dd427;p=idzebra-moved-to-github.git diff --git a/rset/rstemp.c b/rset/rstemp.c index 709dd99..505e38e 100644 --- a/rset/rstemp.c +++ b/rset/rstemp.c @@ -1,5 +1,5 @@ -/* $Id: rstemp.c,v 1.69 2006-11-14 08:12:09 adam Exp $ - Copyright (C) 1995-2006 +/* $Id: rstemp.c,v 1.71 2007-01-15 15:10:19 adam Exp $ + Copyright (C) 1995-2007 Index Data ApS This file is part of the Zebra server. @@ -168,13 +168,18 @@ static void r_flush(RSFD rfd, int mk) { #if HAVE_MKSTEMP char template[1024]; + + *template = '\0'; + if (info->temp_path) - sprintf(template, "%s/zrsXXXXXX", info->temp_path); - else - sprintf(template, "zrsXXXXXX"); + sprintf(template, "%s/", info->temp_path); + strcat(template, "zrs_"); +#if HAVE_UNISTD_H + sprintf(template + strlen(template), "%ld_", (long) getpid()); +#endif + strcat(template, "XXXXXX"); info->fd = mkstemp(template); - if (info->fd == -1) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "rstemp: mkstemp %s", template);