summaryrefslogtreecommitdiff
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-08-07 10:18:59 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-08-07 13:02:53 +0200
commitf854efd041b816553d0710dd0fd5d7372144443c (patch)
tree0b4936ff81063cf703e3dadbdced871cf4b57b31 /src/bin/efreet
parent6a7f417cec98cd5e84c6bc8e8aefba75b2902a39 (diff)
efreet: Use mkstemp for tempfile
CID: #1039615
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreetd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index 66ca956f19..fd4e8a05f0 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -26,13 +26,15 @@ quit(void)
26int 26int
27main(int argc, char *argv[]) 27main(int argc, char *argv[])
28{ 28{
29 char buf[PATH_MAX]; 29 char path[PATH_MAX];
30 char *path;
31 FILE *log; 30 FILE *log;
32 31
33 strcpy(buf, "/tmp/efreetd_XXXXXX"); 32 strcpy(path, "/tmp/efreetd_XXXXXX");
34 path = mktemp(buf); 33 if (mkstemp(path) < 0)
35 if (!path) return 1; 34 {
35 perror("mkstemp");
36 return 1;
37 }
36 if (chmod(path, 0700) < 0) 38 if (chmod(path, 0700) < 0)
37 { 39 {
38 perror("chmod"); 40 perror("chmod");