mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
Make the play-pen searching routine even more agile in trying
to create a /usr/tmp dir if it makes sense to do so.
This commit is contained in:
parent
bb462e80e7
commit
58ab1c7453
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef lint
|
||||
static const char *rcsid = "$Id: pen.c,v 1.15 1995/08/17 00:36:06 jkh Exp $";
|
||||
static const char *rcsid = "$Id: pen.c,v 1.16 1995/08/26 10:15:18 jkh Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -47,6 +47,8 @@ find_play_pen(size_t sz)
|
|||
strcpy(Pen, "/var/tmp/instmp.XXXXXX");
|
||||
else if (stat("/tmp", &sb) != FAIL && min_free("/tmp") >= sz)
|
||||
strcpy(Pen, "/tmp/instmp.XXXXXX");
|
||||
else if ((stat("/usr/tmp", &sb) == SUCCESS | mkdir("/usr/tmp", 01777) == SUCCESS) && min_free("/usr/tmp") >= sz)
|
||||
strcpy(Pen, "/usr/tmp/instmp.XXXXXX");
|
||||
else barf("Can't find enough temporary space to extract the files, please set\nyour PKG_TMPDIR environment variable to a location with at least %d bytes\nfree.", sz);
|
||||
return Pen;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue