Is there a real point to all this code in pg_backup_directory.c?
createDirectory(const char *dir)
struct stat st;
/* the directory must not exist yet. */
if (stat(dir, &st) == 0)
"cannot create directory %s, it exists already\n",
"cannot create directory %s, a file with this name "
"exists already\n", dir);
* Now we create the directory. Note that for some race condition we could
* also run into the situation that the directory has been created just
* between our two calls.
if (mkdir(dir, 0700) < 0)
exit_horribly(modulename, "could not create directory %s: %s\n",
Couldn't we just call mkdir() and report the strerrno(errno) to begin
with, like everyone else does?
pgsql-hackers by date
|Next:||From: Tom Lane||Date: 2012-07-19 19:15:20|
|Subject: Re: very elaborate mkdir error checking in pg_dump|
|Previous:||From: Tom Lane||Date: 2012-07-19 18:57:26|
|Subject: Re: [PERFORM] DELETE vs TRUNCATE explanation|