mirror of https://github.com/sipwise/sems.git
Instead of using the `tmpnam()` which doesn't exclude race conditions on the system (same filenames created simultaneously), because it doesn't open/reserve the file, just use the `mkstemp()` which actually genereates a filename and creates the file for the process. Upon creating the file, close the FD, as not needed atm. This file can be then later opened using `SCPopenAction` or anything alike. Current new implementation does not unlink the file from the filesystem and a user of it has to explicitly do that later with for example the `sys.unlink()` from this same library. Additionally: to be able to have excplicit file path (so dir), add a second parameter to this function to provide a directory. Fixes: warning: the use of `tmpnam' is dangerous, better use `mkstemp' Change-Id: Ib5e89461b2d2288be77d5f1a899e5293b76ebf90master
parent
8211e8ca55
commit
ccdebb29c4
Loading…
Reference in new issue