ALT Linux Bugzilla
– Attachment 724 Details for
Bug 5988
imake dumps core
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
patch
xorg-x11-6.8.1.904-alt-imake-tmpdir.patch (text/plain), 2.02 KB, created by
Valery Inozemtsev
on 2005-02-09 15:42:05 MSK
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Valery Inozemtsev
Created:
2005-02-09 15:42:05 MSK
Size:
2.02 KB
patch
obsolete
>--- xc/config/imake/imake.c.orig 2004-11-22 15:45:08 +0300 >+++ xc/config/imake/imake.c 2005-02-09 15:27:02 +0300 >@@ -278,6 +278,8 @@ > > #if !(defined(Lynx) || defined(__Lynx__) || (defined(SVR4) && !defined(sun))) && !defined (__CYGWIN__) > #define HAS_MKSTEMP >+#include <error.h> >+extern const char *__progname; > #endif > > typedef unsigned char boolean; >@@ -426,6 +428,17 @@ > } else { > #ifdef HAS_MKSTEMP > int fd; >+ const char suffix[] = ".XXXXXX"; >+ const char *tmp_dir = getenv("TMPDIR")?:"/tmp"; >+ unsigned tmp_len = strlen( tmp_dir ); >+ unsigned prog_len = strlen( __progname ); >+ char tmpbuf[ tmp_len + prog_len + sizeof(suffix) + 1 ]; >+ >+ memcpy( tmpbuf, tmp_dir, tmp_len ); >+ tmpbuf[ tmp_len ] = '/'; >+ memcpy( tmpbuf + tmp_len + 1, __progname, prog_len ); >+ memcpy( tmpbuf + tmp_len + prog_len + 1, suffix, sizeof(suffix) ); >+ > #endif > tmpMakefile = Strdup(tmpMakefile); > #ifndef HAS_MKSTEMP >@@ -434,7 +447,8 @@ > LogFatal("Cannot create temporary file %s.", tmpMakefile); > } > #else >- fd = mkstemp(tmpMakefile); >+ fd = mkstemp(tmpbuf); >+ tmpMakefile = strdup(tmpbuf); > if (fd == -1 || (tmpfd = fdopen(fd, "w+")) == NULL) { > if (fd != -1) { > unlink(tmpMakefile); close(fd); >@@ -1786,6 +1800,17 @@ > if (outFile == NULL) { > #ifdef HAS_MKSTEMP > int fd; >+ const char suffix[] = ".XXXXXX"; >+ const char *tmp_dir = getenv("TMPDIR")?:"/tmp"; >+ unsigned tmp_len = strlen( tmp_dir ); >+ unsigned prog_len = strlen( __progname ); >+ char tmpbuf[ tmp_len + prog_len + sizeof(suffix) + 1 ]; >+ >+ memcpy( tmpbuf, tmp_dir, tmp_len ); >+ tmpbuf[ tmp_len ] = '/'; >+ memcpy( tmpbuf + tmp_len + 1, __progname, prog_len ); >+ memcpy( tmpbuf + tmp_len + prog_len + 1, suffix, sizeof(suffix) ); >+ > #endif > tmpImakefile = Strdup(tmpImakefile); > #ifndef HAS_MKSTEMP >@@ -1795,7 +1820,8 @@ > tmpImakefile); > } > #else >- fd=mkstemp(tmpImakefile); >+ fd=mkstemp(tmpbuf); >+ tmpImakefile = strdup(tmpbuf); > if (fd != -1) > outFile = fdopen(fd, "w"); > if (outFile == NULL) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 5988
: 724