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
* 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);
}