Switch to unified view

a/src/utils/smallut.cpp b/src/utils/smallut.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.5 2005-03-17 14:02:06 dockes Exp $ (C) 2004 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: smallut.cpp,v 1.6 2005-10-21 08:14:42 dockes Exp $ (C) 2004 J.F.Dockes";
3
#endif
3
#endif
4
#ifndef TEST_SMALLUT
4
#ifndef TEST_SMALLUT
5
#include <string>
5
#include <string>
6
#include <ctype.h>
6
#include <ctype.h>
7
#include <unistd.h>
7
#include <unistd.h>
...
...
31
    char *cp = strdup(tdir.c_str());
31
    char *cp = strdup(tdir.c_str());
32
    if (!cp) {
32
    if (!cp) {
33
        LOGERR(("maketmpdir: out of memory (for file name !)\n"));
33
        LOGERR(("maketmpdir: out of memory (for file name !)\n"));
34
        tdir.erase();
34
        tdir.erase();
35
        return false;
35
        return false;
36
    } 
36
    }
37
#ifdef HAVE_MKDTEMP
38
  if (!mkdtemp(cp)) {
39
#else
37
    if (!mktemp(cp)) {
40
    if (!mktemp(cp)) {
41
#endif // HAVE_MKDTEMP
38
        free(cp);
42
        free(cp);
39
        LOGERR(("maketmpdir: mktemp failed\n"));
43
        LOGERR(("maketmpdir: mktemp failed\n"));
40
        tdir.erase();
44
        tdir.erase();
41
        return false;
45
        return false;
42
    }   
46
    }   
43
    tdir = cp;
47
    tdir = cp;
44
    free(cp);
48
    free(cp);
45
    }
49
    }
46
50
#ifndef HAVE_MKDTEMP
47
    if (mkdir(tdir.c_str(), 0700) < 0) {
51
    if (mkdir(tdir.c_str(), 0700) < 0) {
48
    LOGERR(("maketmpdir: mkdir %s failed\n", tdir.c_str()));
52
    LOGERR(("maketmpdir: mkdir %s failed\n", tdir.c_str()));
49
    tdir.erase();
53
    tdir.erase();
50
    return false;
54
    return false;
51
    }
55
    }
56
#endif
52
    return true;
57
    return true;
53
}
58
}
54
59
55
string stringlistdisp(const list<string>& sl)
60
string stringlistdisp(const list<string>& sl)
56
{
61
{