From 13de17d4246d3d9cd64210f7f2c7702d9d2bb38f Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sat, 3 Dec 2005 15:09:06 +0000 Subject: [PATCH] Auto creating hatch directories --- ChangeLog | 1 + lib/mbfile.c | 2 +- mbfido/hatch.c | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 22bab4ec..933ec201 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ v0.83.2 16-Nov-2005 Reinstalled tic orphans and bad crc handling using new method. Removed some debug logging. Now using new tmp workdirectory functions. + When a hatch directory doesn't exist, it is created. mbfile: Now using new tmp workdirectory functions. diff --git a/lib/mbfile.c b/lib/mbfile.c index 7d261650..5e0de612 100644 --- a/lib/mbfile.c +++ b/lib/mbfile.c @@ -245,7 +245,7 @@ int mkdirs(char *name, mode_t mode) if ((last == 0) || (last == EEXIST)) { return TRUE; } else { - WriteError("$mkdirs(%s)", name); + WriteError("mkdirs(%s)", name); return FALSE; } } diff --git a/mbfido/hatch.c b/mbfido/hatch.c index 5546423e..a01c6abc 100644 --- a/mbfido/hatch.c +++ b/mbfido/hatch.c @@ -107,6 +107,11 @@ int CheckHatch(char *temp) char mask[256]; FILE *Tf; + if (mkdirs(temp, 0775) == FALSE) { + WriteError("Can't create dir %s", temp); + return FALSE; + } + fn = xstrcpy(strrchr(temp, '/') + 1); while (temp[strlen(temp) -1] != '/')