summaryrefslogtreecommitdiffstats
path: root/loader2/fwloader.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2007-12-27 13:26:58 -0500
committerJeremy Katz <katzj@redhat.com>2007-12-27 13:26:58 -0500
commite6c987e5d403e0e77625ab8e8e914b18c7a38209 (patch)
tree8069d36cc683d7230afb7d8413f8bddff7b91276 /loader2/fwloader.c
parenta38d43ac62493687142dd085685a1c54743375d6 (diff)
downloadanaconda-e6c987e5d403e0e77625ab8e8e914b18c7a38209.tar.gz
anaconda-e6c987e5d403e0e77625ab8e8e914b18c7a38209.tar.xz
anaconda-e6c987e5d403e0e77625ab8e8e914b18c7a38209.zip
Use mkstemp() instead of tempnam()
Diffstat (limited to 'loader2/fwloader.c')
-rw-r--r--loader2/fwloader.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/loader2/fwloader.c b/loader2/fwloader.c
index e5e59a462..2c1e9b6d2 100644
--- a/loader2/fwloader.c
+++ b/loader2/fwloader.c
@@ -454,14 +454,10 @@ static void load_firmware(struct fw_loader *fwl, struct uevent *uevent)
char *tempfile;
int fd = -1;
- if (!(tempfile = tempnam("/tmp/", "fw-")))
+ tempfile = strdup("/tmp/fw-XXXXXX");
+ fd = mkstemp(tempfile);
+ if (fd == -1)
return;
-
- if ((fd = open(tempfile, O_RDWR | O_EXCL | O_CREAT, 0600)) < 0) {
- free(tempfile);
- return;
- }
-
unlink(tempfile);
free(tempfile);