Added -s functionality
This commit is contained in:
parent
7989f0d9ca
commit
16f21b4a9a
1 changed files with 5 additions and 2 deletions
|
|
@ -35,10 +35,13 @@ int make_skratch_file(struct Flags *f)
|
||||||
{
|
{
|
||||||
char fp[4096];
|
char fp[4096];
|
||||||
int fd = 0;
|
int fd = 0;
|
||||||
snprintf(fp, sizeof(fp), "%s/%s", f->skratch_path, f->filename);
|
if (!f->use_s) f->suffix = "";
|
||||||
|
|
||||||
|
snprintf(fp, sizeof(fp), "%s/%s%s", f->skratch_path, f->filename, f->suffix);
|
||||||
if (!strcmp(f->filename, "skratch-XXXXXX"))
|
if (!strcmp(f->filename, "skratch-XXXXXX"))
|
||||||
{
|
{
|
||||||
fd = mkstemp(fp);
|
int s_len = strlen(f->suffix);
|
||||||
|
fd = mkstemps(fp, s_len);
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue