Commit d7f595db authored by Ken Coar's avatar Ken Coar
Browse files

	Be more expliciti in our error messages if the tmpnam() call fails,
	or we have trouble opening the filename it returns.

PR:		Not a solution, but will help debug several


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85129 13f79535-47bb-0310-9956-ffa450edef68
parent f4e9af80
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -518,9 +518,17 @@ int main(int argc, char *argv[])
     * to add or update.  Let's do it..
     */
    tempfilename = tmpnam(NULL);
    if ((tempfilename == NULL) || (strlen(tempfilename) == 0)) {
	fprintf(stderr, "%s: unable to generate temporary filename\n",
		argv[0]);
	errno = ENOENT;
	perror("tmpnam");
	exit(ERR_FILEPERM);
    }
    ftemp = fopen(tempfilename, "w+");
    if (ftemp == NULL) {
	fprintf(stderr, "%s: unable to create temporary file\n", argv[0]);
	fprintf(stderr, "%s: unable to create temporary file '%s'\n", argv[0],
		tempfilename);
	perror("fopen");
	exit(ERR_FILEPERM);
    }