Re: Bug#37573: wmaker cannot save state
>> "Marcelo E. Magallon" <mmagallo@efis.ucr.ac.cr> writes:
> | > rename("/var/tmp/.7J82HT", "/home/pot/GNUstep/Defaults/WMState") = -1 EXDEV
> | > (Invalid cross-device link)
Ok, I fixed a problem in libproplist using tempnam(3) but tempnam
does this:
a) The directory specified by the environment
variable TMPDIR, if it is writable.
b) The directory specified by the argument dir,
if it is not NULL.
I want b), not a). How do I fix this? I guess I can dig libc,
extract tmpnam, remove a), and be done with it, but this is very
ugly. The other option is something like this:
tmpdir = strdup(getenv("TMPDIR"));
unsetenv("TMPDIR");
tempnam (my_dir, "some_prefix");
setenv("TMPDIR", tmpdir, 1);
not really elegant either, but cleaner than the other option I guess.
(btw, do I have to use strdup here? from getenv(3) I don't understand
if it's safe or not to use the pointer it returns)
Thanks,
Marcelo
Reply to: