aboutsummaryrefslogtreecommitdiffstats
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
parentefreet: Check return value of chmod (diff)
downloadefl-f854efd041b816553d0710dd0fd5d7372144443c.tar.gz
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)
int
main(int argc, char *argv[])
{
- char buf[PATH_MAX];
- char *path;
+ char path[PATH_MAX];
FILE *log;
- strcpy(buf, "/tmp/efreetd_XXXXXX");
- path = mktemp(buf);
- if (!path) return 1;
+ strcpy(path, "/tmp/efreetd_XXXXXX");
+ if (mkstemp(path) < 0)
+ {
+ perror("mkstemp");
+ return 1;
+ }
if (chmod(path, 0700) < 0)
{
perror("chmod");