Re: [PATCH] portable use of mktemp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 15, 2018 at 8:25 AM, Josh Triplett <josh@xxxxxxxxxxxxxxxx> wrote:
> On Fri, Jun 15, 2018 at 06:37:01AM +0200, Luc Van Oostenryck wrote:
>> Most manpages for mktemp(1) specify that the 'XXXXXX' part of the
>> template must be at the end (of course, the GNU's version accept
>> it anywhere). At least the busybox's version used by Alpine Linux
>> tries to enforce that and fails in sparse current use of it:
>>       tmp.XXXXXX.{llvm,o}
>>
>> Fix that by moving the XXXXXX at the end like:
>>       tmp.{l,o}.XXXXXX
>
> That's rather annoying, as busybox mktemp also doesn't support --suffix.
> I don't see any way around it, though.

Another solution would be to create a temp dir:
    DIR=$(mktemp -d tmp.XXXXXX)
    TMPLLVM="$DIR/tmp.llvm"
    TMPFILE="$DIR/tmp.o"

The advantage would be to have a single call to mktemp and the  .{llvm,o}
at the end of the files but it would need a rmdir at the end.

I don't have a strong opinion about it.
[More annoying to me is the case of timeout(1) which is used in a few testcases.
 The busybox version requires that the timeout is given by '-t ...'
and don't have
 the '-k' option ].

-- Luc
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux