Re: [PATCH] portable use of mktemp

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

 



On Fri, Jun 15, 2018 at 09:34:43AM +0200, Luc Van Oostenryck wrote:
> 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.

Doesn't seem worth it. The file extensions on the intermediate files
don't matter *that* much.

- Josh
--
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