FreeBSD Bugzilla – Attachment 24919 Details for
Bug 42510
Fix build of news/knews on -current
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 817 bytes, created by
Steven G. Kargl
on 2002-09-07 18:10:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Steven G. Kargl
Created:
2002-09-07 18:10:02 UTC
Size:
817 bytes
patch
obsolete
>--- src/file.c.orig Sat Sep 7 09:12:38 2002 >+++ src/file.c Sat Sep 7 09:53:48 2002 >@@ -185,16 +185,20 @@ > int create_temp_fd(char **name) > { > int fd; >- >- *name = tmpnam(NULL); >- if (!*name) >- fd = -1; >- else { >- unlink(*name); >- fd = open(*name, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR); >- if (fd < 0) >- *name = NULL; >- } >+ char filename[FILENAME_MAX]; >+ >+ if (getenv("TMPDIR") != NULL) { >+ strlcpy(filename, getenv("TMPDIR"), FILENAME_MAX); >+ strlcat(filename, "/tmp.XXXXXX", FILENAME_MAX); >+ } else if (access("/var/tmp", (R_OK|W_OK)) == 0) >+ strlcpy(filename, "/var/tmp/tmp.XXXXXX", FILENAME_MAX); >+ else >+ strlcpy(filename, "tmp.XXXXXX", FILENAME_MAX); >+ >+ if ((fd = mkstemp(filename)) == -1) >+ *name = NULL; >+ else >+ *name = filename; > > return fd; > }
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 42510
: 24919