mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-24 08:56:24 -05:00
general code cleanup
This commit is contained in:
parent
5a1a60742e
commit
9d9ee7b71d
178 changed files with 5100 additions and 5255 deletions
|
|
@ -18,29 +18,29 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace fs
|
||||
{
|
||||
static
|
||||
inline
|
||||
int
|
||||
mkstemp(std::string &filepath)
|
||||
mkstemp(std::string &filepath_)
|
||||
{
|
||||
int fd;
|
||||
char buf[filepath.size()+8];
|
||||
char buf[filepath_.size()+8];
|
||||
|
||||
strcpy(buf,filepath.c_str());
|
||||
strcpy(buf+filepath.size(),".XXXXXX");
|
||||
strcpy(buf,filepath_.c_str());
|
||||
strcpy(buf+filepath_.size(),".XXXXXX");
|
||||
|
||||
fd = ::mkstemp(buf);
|
||||
if(fd == -1)
|
||||
return -1;
|
||||
|
||||
filepath = buf;
|
||||
filepath_ = buf;
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue