[Gluster-devel] mkostemp vs mkstemp?

Emmanuel Dreyfus manu at netbsd.org
Thu Oct 18 04:54:53 UTC 2012


Hi

mkostemp() is GNU libc specific. It is used once in glusterfs source, with flags
that seem to do exactly what POSIX-compliant mkstemp() does. 

Would there be any issue that I missed with the change below?

--- libglusterfs/src/statedump.c.orig   2012-10-18 06:26:52.000000000 +0200
+++ libglusterfs/src/statedump.c        2012-10-18 06:36:27.000000000 +0200
@@ -57,9 +57,9 @@
 gf_proc_dump_open (char *tmpname)
 {
         int  dump_fd = -1;
 
-        dump_fd = mkostemp (tmpname, O_CREAT|O_EXCL|O_RDWR|O_TRUNC|O_APPEND);
+        dump_fd = mkstemp (tmpname);
         if (dump_fd < 0)
                 return -1;
 
         gf_dump_fd = dump_fd;

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu at netbsd.org




More information about the Gluster-devel mailing list